A "Hashable" format does not have to comply with the original; the only requirement is that it is reproducible.
However, I have difficulties coming up with a good argument for not sticking to the original.
If you stick to the original, then the terms Hashable and Canonicalizable become fully interchangeable.
I could though imagine representing "Number" as IEEE-754 8-byte binary blobs instead of a textual format but the availability of a useful definition and implementation in ES6, makes this less appetizing.
Note that the availability of canonicalization DOES NOT mean that you MUST use it as the "wire format".
In my own applications [*], I do not intend to use "JSON.canonicalize()" except internally for crypto related operations.
Why is that? Because it breaks the "natural order" provided by JSON.stringify().
A "Hashable" format does not have to comply with the original; the only requirement is that it is reproducible.
However, I have difficulties coming up with a good argument for not sticking to the original.
If you stick to the original, then the terms Hashable and Canonicalizable become fully interchangeable.
I could though imagine representing "Number" as IEEE-754 8-byte binary blobs instead of a textual format but the availability of a useful definition and implementation in ES6, makes this less appetizing.
Note that the availability of canonicalization DOES NOT mean that you MUST use it as the "wire format".
In my own applications [*], I do not intend to use "JSON.canonicalize()" except internally for crypto related operations.
Why is that? Because it breaks the "natural order" provided by JSON.stringify().
thanx,
Anders
*] https://cyberphone.github.io/doc/saturn/
A "Hashable" format does not have to comply with the original; the only requirement is that it is reproducible. However, I have difficulties coming up with a good argument for not sticking to the original. If you stick to the original, then the terms Hashable and Canonicalizable become fully interchangeable.
I could though imagine representing "Number" as IEEE-754 8-byte binary blobs instead of a textual format but the availability of a useful definition and implementation in ES6, makes this less appetizing.
Note that the availability of canonicalization DOES NOT mean that you MUST use it as the "wire format".
In my own applications [*], I do not intend to use "JSON.canonicalize()" except internally for crypto related operations. Why is that? Because it breaks the "natural order" provided by JSON.stringify().
thanx, Anders
*] cyberphone.github.io/doc/saturn