The keys in every map must be sorted lowest value to highest.
Sorting is performed on the bytes of the representation of the key
data items without paying attention to the 3/5 bit splitting for
major types. (Note that this rule allows maps that have keys of
different types, even though that is probably a bad practice that
could lead to errors in some canonicalization implementations.)
The sorting rules are:
* If two keys have different lengths, the shorter one sorts
earlier;
* If two keys have the same length, the one with the lower value
in (byte-wise) lexical order sorts earlier.
According to https://tools.ietf.org/html/rfc7049#section-3.9
all keys in maps need to be sorted. Looking at https://github.com/hildjj/node-cbor/blob/master/src/encoder.coffee#L238-L260 it does not look like this is currently happening.
Ref https://github.com/ipld/js-ipld/issues/19