danang-id / simple-crypto-js

Simplified AES cryptography for safer and easier encryption and decryption processes of any JavaScript objects.
https://simplecrypto.js.org
MIT License
85 stars 27 forks source link

Big numbers don't work #42

Open leonmak opened 2 years ago

leonmak commented 2 years ago
const simpleCrypto = new SimpleCrypto('a very secret key')
const a = simpleCrypto.encrypt(76561198028033919)
simpleCrypto.decrypt(a) // 76561198028033920 
salohcin714 commented 2 years ago

@leonmak

There are two types of numbers in Javascript: Number and BigInt

Number is safe to be use for any number +/- 9,007,199,254,740,991

Numbers outside of this range should be converted to BigInt.