Socket
Socket
Sign inDemoInstall

bn.js

Package Overview
Dependencies
0
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.5.2 to 4.6.0

2

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

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

@@ -97,2 +97,3 @@ # <img src="./logo.png" alt="bn.js" width="160" height="160" />

* `a.bincn(b)` - add `1 << b` to the number
* `a.notn(w)` - not (for the width specified by `w`) (`i`)

@@ -99,0 +100,0 @@ ### Reduction

@@ -200,2 +200,26 @@ var assert = require('assert');

});
describe('.notn()', function() {
it('should allow bitwise negation', function () {
assert.equal(new BN('111000111', 2).notn(9).toString(2),
'111000');
assert.equal(new BN('000111000', 2).notn(9).toString(2),
'111000111');
assert.equal(new BN('111000111', 2).notn(9).toString(2),
'111000');
assert.equal(new BN('000111000', 2).notn(9).toString(2),
'111000111');
assert.equal(new BN('111000111', 2).notn(32).toString(2),
'11111111111111111111111000111000');
assert.equal(new BN('000111000', 2).notn(32).toString(2),
'11111111111111111111111111000111');
assert.equal(new BN('111000111', 2).notn(68).toString(2),
'11111111111111111111111111111111' +
'111111111111111111111111111000111000');
assert.equal(new BN('000111000', 2).notn(68).toString(2),
'11111111111111111111111111111111' +
'111111111111111111111111111111000111');
});
});
});

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc