modexp64
Modular exponentiation in NodeJS using 64 bits unsigned numbers. Implemented in C++.
Installation
Install via npm:
npm install modexp64 --save
Example usage
var modexp = ; // 0x3E8 = 1000// It calcs (2^10) % 1000var result = ; // Prints 18 (in hexadecimal)console; // Prints 24 (in decimal)console;
API Documentation
modexp(base, exp, mod): It takes 3 strings. They can be decimal numbers or hexadecimal ones (prefixed with "0x"). It returns a string with the result in hexadecimal (with no prefix).