jsbn
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
JSBN, or JavaScript Big Number, is a high-performance, portable library designed for extensive number computations in pure JavaScript. Its primary function is to facilitate public-key cryptography and similar applications on both desktop and mobile browsers. The library is developed from Tom Wu's original code and leverages a module pattern that prevents global leaks and can be utilized on both client and server-side through Node.js.
To use JSBN, you must first install the package and require it in your JavaScript file. With JSBN, you can create an instance of BigInteger using large numbers as a string. Here's a basic example of how you might use JSBN:
// Include the JSBN library
var BigInteger = require('jsbn').BigInteger;
// Create a new BigInteger object
var bi = new BigInteger('91823918239182398123');
// Use one of the jsbn methods
console.log(bi.bitLength()); // Outputs: 67
Additionally, JSBN provides a comprehensive API enabling you to perform various operations such as addition, subtraction, multiplication, division, and many more on the BigInteger instances.
For detailed information on how to use the library and its API, consult the JSBN documentation on Tom Wu's original website, accessible here: Tom Wu's Original Website. All the API methods listed in the readme file including but not limited to toString()
, negate()
, abs
, compareTo
, bitLength
, are explained elaborately on Tom Wu's website.