-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix encoding/decoding of base-256 numbers
- Encoding/decoding of base-256 numbers failed to failed to handle last byte in buffer. Handling was previously broken. - Take javascript's MAX_SAFE_INTEGER / MIN_SAFE_INTEGER into account when encoding/decoding. Namely, if the numbers cannot accurately be represented in javascript with integer-precision, a TypeError will be thrown. - Throw a TypeError if the parser is passed an buffer that does not appear to be base-256 encoded. (must start with 0x80 or 0xff)
- Loading branch information
1 parent
b863448
commit c80341a
Showing
2 changed files
with
89 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters