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

biggystring

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

biggystring - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

lib/index.js.flow

36

lib/index.es.js

@@ -118,2 +118,34 @@ /**

function min(x, y, base = 10) {
const xBase = isHex(x) ? 16 : 10;
const yBase = isHex(y) ? 16 : 10;
x = cropHex(x);
y = cropHex(y);
const xBN = new BN(x, xBase);
const yBN = new BN(y, yBase);
let out;
if (xBN.lte(yBN)) {
out = xBN.toString(base);
} else {
out = yBN.toString(base);
}
return base === 10 ? out : '0x' + out;
}
function max(x, y, base = 10) {
const xBase = isHex(x) ? 16 : 10;
const yBase = isHex(y) ? 16 : 10;
x = cropHex(x);
y = cropHex(y);
const xBN = new BN(x, xBase);
const yBN = new BN(y, yBase);
let out;
if (xBN.gte(yBN)) {
out = xBN.toString(base);
} else {
out = yBN.toString(base);
}
return base === 10 ? out : '0x' + out;
}
function divf(x, y) {

@@ -193,5 +225,5 @@ const shift = log10(y);

const bns = { add, sub, mul, div, gt, lt, gte, lte, eq, mulf, divf };
const bns = { add, sub, mul, div, gt, lt, gte, lte, eq, mulf, divf, min, max };
export { add, sub, mul, div, gt, lt, gte, lte, eq, mulf, divf, bns };
export { add, sub, mul, div, gt, lt, gte, lte, eq, mulf, divf, min, max, bns };
//# sourceMappingURL=index.es.js.map

@@ -122,2 +122,34 @@ 'use strict';

function min(x, y, base = 10) {
const xBase = isHex(x) ? 16 : 10;
const yBase = isHex(y) ? 16 : 10;
x = cropHex(x);
y = cropHex(y);
const xBN = new BN(x, xBase);
const yBN = new BN(y, yBase);
let out;
if (xBN.lte(yBN)) {
out = xBN.toString(base);
} else {
out = yBN.toString(base);
}
return base === 10 ? out : '0x' + out;
}
function max(x, y, base = 10) {
const xBase = isHex(x) ? 16 : 10;
const yBase = isHex(y) ? 16 : 10;
x = cropHex(x);
y = cropHex(y);
const xBN = new BN(x, xBase);
const yBN = new BN(y, yBase);
let out;
if (xBN.gte(yBN)) {
out = xBN.toString(base);
} else {
out = yBN.toString(base);
}
return base === 10 ? out : '0x' + out;
}
function divf(x, y) {

@@ -197,3 +229,3 @@ const shift = log10(y);

const bns = { add, sub, mul, div, gt, lt, gte, lte, eq, mulf, divf };
const bns = { add, sub, mul, div, gt, lt, gte, lte, eq, mulf, divf, min, max };

@@ -211,3 +243,5 @@ exports.add = add;

exports.divf = divf;
exports.min = min;
exports.max = max;
exports.bns = bns;
//# sourceMappingURL=index.js.map

8

package.json
{
"name": "biggystring",
"version": "1.0.5",
"version": "1.0.6",
"description": "Wrapper for bn.js to directly operate on strings as big numbers",

@@ -32,2 +32,4 @@ "main": "./lib/index.js",

"flow-bin": "^0.49.1",
"flow-copy-source": "^1.2.1",
"husky": "^0.14.3",
"mocha": "^3.1.2",

@@ -47,6 +49,8 @@ "rollup": "^0.43.1",

"rollup": "rollup -c",
"build": "npm run lint && npm run prepare && npm run flow",
"build": "npm run lint && npm run prepare && npm run build:flow",
"build:flow": "npm run flow && flow-copy-source -v -i '**/test/**' src lib",
"cover": "nyc --reporter=lcov --reporter=text --reporter=html --extension .js npm test",
"lint --fix": "standard '*.js' 'src/**/*.js' --fix",
"lint": "standard '*.js' 'src/**/*.js'",
"precommit": "npm test",
"prepare": "npm run rollup",

@@ -53,0 +57,0 @@ "test": "npm run build && mocha"

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