couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <j...@mooseyard.com>
Subject Re: Canonical JSON [Proposal for digital signatures of documents]
Date Mon, 09 Mar 2009 17:22:41 GMT

On Mar 8, 2009, at 4:51 PM, Antony Blakey wrote:

> OLPC has a start on canonical JSON: http://wiki.laptop.org/go/Canonical_JSON 
> .

Thanks for the link! I'd done a bit of searching for prior-art, but  
hadn't run across that.

It's pretty close to my description. It looks good, except that

• They say that arbitrary byte sequences are allowed in strings. This  
is really problematic (it makes it impossible to reliably convert JSON  
to an in-memory JavaScript string object!) and contradicts the JSON  
spec, whose third paragraph says that "a string is a  sequence of zero  
or more Unicode characters".

• As I did, they say keys should be sorted in "lexicographic order".  
Like me, they probably meant "code-point order".

The ban on floating-point numbers is sensible. I'd draw the line at  
banning integers, though, as that tends to really complicate round- 
trip transformations with in-memory objects. (Every int field has to  
be shadowed as a string.)

I've updated the wiki page accordingly.

—Jens
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message