Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

bn.js

Package Overview
Dependencies
Maintainers
1
Versions
124
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
+18
-1
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;

+1
-1
{
"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 @@

-10
var bn = require('./');
var a1 = new bn('012345678901234567890123456789012345678901234567890', 10);
var b1 = new bn('7654213509123601923760129376102397651203958123402314875', 10);
var t = 0;
var x = b1.div(a1);
console.log(t);

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