Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Need to check for "MAX_SAFE_*" values. #3

Open
JalonSolov opened this issue May 21, 2020 · 0 comments
Open

Need to check for "MAX_SAFE_*" values. #3

JalonSolov opened this issue May 21, 2020 · 0 comments

Comments

@JalonSolov
Copy link

JSON comes from JavaScript, and JavaScript has limitations on what numbers can be used without hitting problems.

"The JavaScript Number type is double-precision 64-bit binary format IEEE 754 value. There is no integer type. In more recent implementations, JavaScript also supports arbitrarily large integers using the BigInt type."

This means that decoding should probably take a flag as to whether or not to reject numbers outside the "safe" range - basically +/- (2^53)-1.

That said, the JSON format itself has no such limitations, so any size numbers could be allowed, if you're not worried about interoperability.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant