You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Large integers (or strings that contain numerical values that get interpreted as integers) get rounded, even if they were initially intended as strings. See the following repl:
In the meantime one can use the option types: false to keep every value as a string, I'll soon look into adding some BigInt support. Just not sure if enabling it should make all numbers BigInt or only those that are too big to be represented within 48 bits of precision, probably the latter. It would be disabled by default, as BigInt could break existing code that relies on normal numbers
Yet another solution might be to encode the type in the vdf. This is what I ended up doing, eg. A number 1234 gets encoder as "n1234" which is then parsed as 1234, whereas a string "1234" gets encoded as "s1234" which is parsed as "1234"
This amounts to essentially altering the vdf rules and would break in many situations where other programs are reading the vdf, but it worked perfectly for me.
Same issue as here node-steam/vdf#12
Large integers (or strings that contain numerical values that get interpreted as integers) get rounded, even if they were initially intended as strings. See the following repl:
https://replit.com/@ChrisDock/Testing-node-steamvdf-for-long-strings#index.js
The text was updated successfully, but these errors were encountered: