ASON
I have a confession to make. I participated in something horrible recently. I hope that sometime, somewhere, I can forgive myself.
ASON /eɪ - sahn/, short for ASCII JSON is a serialization encoding for JSON invented by Del Johnson, used to tunnel large JSON requests to an application through an Oracle Web Center Interactive portal gateway without triggering errors from the gateway.
ASON is an "ASCII encoding" of JSON text which simultaneously
- is larger than the original JSON text,
- is completely unreadable, and
- adds considerable CPU processing costs to the encoding and decoding of the text.
The steps needed to serialize a message using ASON are simple:
- Build the JSON text as usual.
- Iterate over the characters in the JSON text, building a new string by:
- Converting each character to its decimal numeric representation, and
- separating the decimal numbers with commas.
Deserializing the message is the inverse of serialization.
An example ASON message is:
34,73,32,102,101,101,108,32,100,105,114,116,121,34
[Edit: Great. I can't even look up ASCII correctly anymore. "H feel..." Bah. Thanks, Del.]
[Edit: Further implementation experience with ASON from Del: the JavaScript to encode ASON on IE7 takes roughly two and a half minutes to encode 20k worth of JSON text. This seems to be due to a poor implementation of string concatenation; a naive implementation faced with multiple concatenations would copy the first string and append the second, copy the first two and append the third, copy the first three.... Concatenating the strings this way is O(n2). An alternative of pushing the interim segments into an array and then joining the array is O(n) and takes negligible time.]
Comments
Redemption.
cbass
'2012-03-27T19:39:23.702-05:00'
I am familiar with JSON part, as such it is horrible but it's implementations can manage the secure number encodings, and some frameworks, such as PHP's execution of JSON, always do the secure number encodings of everything.
Unknown
cbass, Del asserts that ASON has an advantage there because the characters are encoded unsigned.
I need a shower.
Tommy McGuire
'2012-03-28T10:44:13.163-05:00'
Terry, I'm not sure what you are referring to.
The problem we had was that WCI (http://www.function1.com/2007/09/know-your-traffic-flow-part-ii/) was blowing chunks on large, JSON-bodied requests going to a back-end application (http://blog.integryst.com/webcenter-interaction/2010/04/03/the-perils-and-pitfalls-of-the-wci-gateway-transformer/). Seems like it didn't like all the characters.
Now I really need a shower.
Tommy McGuire
'2012-03-28T11:01:46.728-05:00'