peterolson / BigInteger.js

An arbitrary length integer library for Javascript
The Unlicense
1.12k stars 187 forks source link

Alphabet on .toString() #242

Closed doriandrn closed 8 months ago

doriandrn commented 8 months ago

Hello,

I've been having a bug in my app for so long and I think I've just figured it out why it is happening.

.toString(radix, alphabet) works all right in my test cases with all radixes and different alphabets, yet it just doesn't when using 10 for radix and an alphabet.

bigInt(5).toString(10, 'ABCDEFGHIJKLMNOP') returns '5' which is not to be found in the alphabet requested.

peterolson commented 8 months ago

fixed in version 1.6.52

doriandrn commented 8 months ago

Thank you!