Comparing version 2.0.0 to 2.0.1
@@ -98,2 +98,8 @@ (function (module, exports) { | ||
assert(typeof number.length === 'number'); | ||
if (number.length <= 0) { | ||
this.words = [ 0 ]; | ||
this.length = 1; | ||
return this; | ||
} | ||
this.length = Math.ceil(number.length / 3); | ||
@@ -100,0 +106,0 @@ this.words = new Array(this.length); |
{ | ||
"name": "bn.js", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Big number implementation in pure javascript", | ||
@@ -5,0 +5,0 @@ "main": "lib/bn.js", |
@@ -1,4 +0,7 @@ | ||
# bn.js [![Build Status](https://secure.travis-ci.org/indutny/bn.js.png)](http://travis-ci.org/indutny/bn.js) | ||
# <img src="./logo.png" alt="bn.js" width="160" height="160" /> | ||
> BigNum in pure javascript | ||
[![Build Status](https://secure.travis-ci.org/indutny/bn.js.png)](http://travis-ci.org/indutny/bn.js) | ||
## Install | ||
@@ -5,0 +8,0 @@ `npm install --save bn.js` |
@@ -68,2 +68,6 @@ var assert = require('assert'); | ||
describe('with Array input', function() { | ||
it('should not fail on empty array', function() { | ||
assert.equal(new BN([ ]).toString(16), '0'); | ||
}); | ||
it('should import/export big endian', function() { | ||
@@ -70,0 +74,0 @@ assert.equal(new BN([ 1, 2, 3 ]).toString(16), '10203'); |
Sorry, the diff of this file is not supported yet
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
108162
2961
128