🚀 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.3

3

lib/bn.js

@@ -1310,3 +1310,4 @@ (function (module, exports) {

a._ishlnsubmul(b, 1, j);
a.sign = !a.sign;
if (a.cmpn(0) !== 0)
a.sign = !a.sign;
}

@@ -1313,0 +1314,0 @@ if (q)

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

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

@@ -328,2 +328,11 @@ var assert = require('assert');

});
it('should properly carry the sign inside division', function() {
var a = new BN('945304eb96065b2a98b57a48a06ae28d285a71b5', 'hex');
var b = new BN(
'fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe',
'hex');
assert.equal(a.mul(b).mod(a).cmpn(0), 0);
});
});

@@ -330,0 +339,0 @@