Closed akalin-keybase closed 6 years ago
You might also say that all encodings must use the minimal number of bytes. This might be more general. For instance isn’t it allowed to encode a one element array in several ways? Of course the smallest representation is the one we expect.
Ah, you're right! Let me rework this PR, then...
Okay, added some wording re. encoding strings, byte arrays, and arrays. Turns out we still have to specify int encodings, though -- in general, there are multiply ways to encode some ints minimally, so we have to at least clarify that the ints we have are small enough to fit in 1 byte. PTAL!
MessagePack has some ambiguity in encoding numbers, so clarify that the version numbers and mode should be encoded as positive fixnums.
Also clarify ambiguity re. encoding strings, bytes arrays, and arrays.
Also add tests.