Comparing version 0.2.1 to 0.2.2
@@ -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; |
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1050
32670
6