New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

int64-native

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

int64-native - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

2

package.json
{
"name": "int64-native",
"version": "0.3.1",
"version": "0.3.2",
"description": "A simple uint64_t wrapper for JavaScript",

@@ -5,0 +5,0 @@ "keywords": [

@@ -53,2 +53,8 @@ var Int64 = require('../int64'),

expect(w.toString()).to.equal('0x0123456789abcdef');
expect(x.and(0xffff).toString()).to.equal('0x0000000000003210');
expect(x.or(0xffff).toString()).to.equal('0xfedcba987654ffff');
expect(x.xor(0xffff).toString()).to.equal('0xfedcba987654cdef');
expect(x.and(0x1ffffffff).toString()).to.equal('0x0000000076543210');
expect(x.or(0x1ffffffff).toString()).to.equal('0xfedcba99ffffffff');
expect(x.xor(0x1ffffffff).toString()).to.equal('0xfedcba9989abcdef');
var a = new Int64(7),

@@ -78,2 +84,30 @@ b = a.shiftLeft(1),

});
it('can be added', function testAdd() {
var a = new Int64(3),
b = new Int64(2),
c = new Int64('0xfffffffffffffffe');
expect(a.add(b).equals(new Int64(5))).to.be.true;
expect(a.add(4).equals(new Int64(7))).to.be.true;
// unsigned integer overflow
expect(c.add(3).equals(new Int64(1))).to.be.true;
// numbers larger than int32
expect(a.add(0x100000000).toString()).to.equal('0x0000000100000003');
});
it('can be subtracted', function testSub() {
var a = new Int64(3),
b = new Int64(2),
c = new Int64('0xffffffffffffffff');
expect(a.sub(b).equals(new Int64(1))).to.be.true;
expect(a.sub(1).equals(new Int64(2))).to.be.true;
// unsigned integer underflow
expect(a.sub(4).equals(new Int64('0xffffffffffffffff'))).to.be.true;
// numbers larger than int32
expect(c.sub(0x100000000).toString()).to.equal('0xfffffffeffffffff');
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc