Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bn.js

Package Overview
Dependencies
Maintainers
1
Versions
119
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 4.10.1 to 4.10.2

2

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

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

@@ -503,5 +503,11 @@ /* global describe, it */

it('should return GCD', function () {
assert.equal(new BN(3).gcd(new BN(2)).toString(16), '1');
assert.equal(new BN(18).gcd(new BN(12)).toString(16), '6');
assert.equal(new BN(-18).gcd(new BN(12)).toString(16), '6');
assert.equal(new BN(3).gcd(new BN(2)).toString(10), '1');
assert.equal(new BN(18).gcd(new BN(12)).toString(10), '6');
assert.equal(new BN(-18).gcd(new BN(12)).toString(10), '6');
assert.equal(new BN(-18).gcd(new BN(-12)).toString(10), '6');
assert.equal(new BN(-18).gcd(new BN(0)).toString(10), '18');
assert.equal(new BN(0).gcd(new BN(-18)).toString(10), '18');
assert.equal(new BN(2).gcd(new BN(0)).toString(10), '2');
assert.equal(new BN(0).gcd(new BN(3)).toString(10), '3');
assert.equal(new BN(0).gcd(new BN(0)).toString(10), '0');
});

@@ -512,6 +518,17 @@ });

it('should return EGCD', function () {
assert.equal(new BN(3).egcd(new BN(2)).gcd.toString(16), '1');
assert.equal(new BN(18).egcd(new BN(12)).gcd.toString(16), '6');
assert.equal(new BN(-18).egcd(new BN(12)).gcd.toString(16), '6');
assert.equal(new BN(3).egcd(new BN(2)).gcd.toString(10), '1');
assert.equal(new BN(18).egcd(new BN(12)).gcd.toString(10), '6');
assert.equal(new BN(-18).egcd(new BN(12)).gcd.toString(10), '6');
assert.equal(new BN(0).egcd(new BN(12)).gcd.toString(10), '12');
});
it('should not allow 0 input', function () {
assert.throws(function () {
BN(1).egcd(0);
});
});
it('should not allow negative input', function () {
assert.throws(function () {
BN(1).egcd(-1);
});
});
});

@@ -524,2 +541,3 @@

assert.equal(BN.max(new BN(2), new BN(2)).toString(16), '2');
assert.equal(BN.max(new BN(2), new BN(-2)).toString(16), '2');
});

@@ -533,2 +551,3 @@ });

assert.equal(BN.min(new BN(2), new BN(2)).toString(16), '2');
assert.equal(BN.min(new BN(2), new BN(-2)).toString(16), '-2');
});

@@ -535,0 +554,0 @@ });

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc