Skip to content

Conversation

@rotemh
Copy link

@rotemh rotemh commented Jan 25, 2019

In some cases, it is important to enable canonical encoding where the encoded value always results in the same sequence of bytes.
In most cases it's, in fact, the case but JS objects' spec has no guarantees with respect to the intrinsic order of the keys. As a result, the encoding depends on the browser implementation.

This PR adds a new option - canonical:true which always encodes in the object keys in alphabetical order and ensures canonical representation.

Please accept this RP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants