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
120
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 0.2.1 to 0.2.2

19

lib/bn.js

@@ -161,2 +161,19 @@ var assert = require('assert');

function zero7(word) {
if (word.length === 6)
return '0' + word;
else if (word.length === 5)
return '00' + word;
else if (word.length === 4)
return '000' + word;
else if (word.length === 3)
return '0000' + word;
else if (word.length === 2)
return '00000' + word;
else if (word.length === 1)
return '000000' + word;
else
return word;
}
BN.prototype.toString = function toString(base) {

@@ -183,3 +200,3 @@ base = base || 10;

if (c.cmp(0) !== 0)
out = zero6(r.words[0] + '') + out;
out = zero7(r.words[0] + '') + out;
else

@@ -186,0 +203,0 @@ out = r.words[0] + out;

2

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

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

@@ -21,2 +21,3 @@ var assert = require('assert');

'a89ce5af8724c0a23e0e0ff77500');
assert.equal(bn('10654321').toString(), '10654321');
});

@@ -23,0 +24,0 @@

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