Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bignum

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bignum - npm Package Compare versions

Comparing version 0.5.3 to 0.5.4

.travis.yml

5

index.js

@@ -315,3 +315,3 @@ try {

var size = opts.size || 1;
var size = opts.size === 'auto' ? Math.ceil(buf.length) : (opts.size || 1);

@@ -380,3 +380,2 @@ if (buf.length % size !== 0) {

;
var size = opts.size || 1;

@@ -388,2 +387,4 @@ var hex = this.toString(16);

var size = opts.size === 'auto' ? Math.ceil(hex.length / 2) : (opts.size || 1);
var len = Math.ceil(hex.length / (2 * size)) * size;

@@ -390,0 +391,0 @@ var buf = new Buffer(len);

2

package.json
{
"name" : "bignum",
"version" : "0.5.3",
"version" : "0.5.4",
"description" : "Arbitrary-precision integer arithmetic using OpenSSL",

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

@@ -427,2 +427,16 @@ var assert = require('assert');

exports.endian = function () {
var a = bignum(0x0102030405);
assert.eql(a.toBuffer({ endian: 'big', size: 2 }).toString('hex'), '000102030405');
assert.eql(a.toBuffer({ endian: 'little', size: 2 }).toString('hex'), '010003020504');
var b = bignum(0x0102030405);
assert.eql(a.toBuffer({ endian: 'big', size: 'auto' }).toString('hex'), '0102030405');
assert.eql(a.toBuffer({ endian: 'little', size: 'auto' }).toString('hex'), '0504030201');
var c = new Buffer("000102030405", 'hex');
assert.eql(bignum.fromBuffer(c, { endian: 'big', size: 'auto'}).toString(16), "0102030405");
assert.eql(bignum.fromBuffer(c, { endian: 'little', size: 'auto'}).toString(16), "050403020100");
}
if (process.argv[1] === __filename) {

@@ -429,0 +443,0 @@ assert.eql = assert.deepEqual;

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