🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

bn.js

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bn.js - npm Package Compare versions

Comparing version

to
2.0.2

5

lib/bn.js

@@ -2164,3 +2164,8 @@ (function (module, exports) {

var w = [];
if (num.cmpn(0) === 0)
return new BN(1);
var q = num.clone();
while (q.cmpn(0) !== 0) {

@@ -2167,0 +2172,0 @@ w.push(q.andln(1));

2

package.json
{
"name": "bn.js",
"version": "2.0.1",
"version": "2.0.2",
"description": "Big number implementation in pure javascript",

@@ -5,0 +5,0 @@ "main": "lib/bn.js",

@@ -92,2 +92,9 @@ var assert = require('assert');

});
it('should pow(base, 0) == 1', function() {
var base = new BN(256).toRed( BN.red('k256'));
var exponent = new BN(0);
var result = base.redPow(exponent);
assert.equal(result.toString(), '1');
});
});

@@ -94,0 +101,0 @@ }