make-github-pseudonymous-again / js-integer

:zzz: Integers for JavaScript (ℤ)
https://make-github-pseudonymous-again.github.io/js-integer
GNU Affero General Public License v3.0
1 stars 0 forks source link

Use a power of two as a base. #52

Open make-github-pseudonymous-again opened 4 years ago

make-github-pseudonymous-again commented 4 years ago

This would enable to use fast conversion to hexadecimal. With the current implementation in @aureooms/js-integer-big-endian we can use base = Math.pow(2,26) | 0. Although v8 does not seem to be able to optimize modulo and division operations at the moment, it could happen eventually?