Comparing version 0.13.2 to 0.13.3
2
1.js
@@ -38,3 +38,3 @@ var BN = require('./'); | ||
function toTyped(n) { | ||
var w = new Uint32Array(Math.min(160, n.length)); | ||
var w = new Uint32Array(Math.max(160, n.length)); | ||
for (var i = 0; i < w.length; i++) | ||
@@ -41,0 +41,0 @@ w[i] = n.words[i] | 0; |
@@ -55,4 +55,12 @@ // Utils | ||
} | ||
this.words = [ number & 0x3ffffff ]; | ||
this.length = 1; | ||
if (number < 0x4000000) { | ||
this.words = [ number & 0x3ffffff ]; | ||
this.length = 1; | ||
} else { | ||
this.words = [ | ||
number & 0x3ffffff, | ||
(number / 0x4000000) & 0x3ffffff | ||
]; | ||
this.length = 2; | ||
} | ||
return; | ||
@@ -59,0 +67,0 @@ } else if (typeof number === 'object') { |
{ | ||
"name": "bn.js", | ||
"version": "0.13.2", | ||
"version": "0.13.3", | ||
"description": "Big number implementation in pure javascript", | ||
@@ -5,0 +5,0 @@ "main": "lib/bn.js", |
@@ -7,2 +7,3 @@ var assert = require('assert'); | ||
assert.equal(new BN(12345).toString(16), '3039'); | ||
assert.equal(new BN(0x4123456).toString(16), '4123456'); | ||
}); | ||
@@ -9,0 +10,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
62811
2014