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

bignum

Package Overview
Dependencies
Maintainers
3
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.9.3 to 0.10.0

test/isbignum.js

34

index.js

@@ -50,2 +50,14 @@ try {

BigNum.isBigNum = function(num) {
if (!num) {
return false;
}
for(var key in BigNum.prototype) {
if (!num[key]) {
return false;
}
}
return true;
};
BigNum.prototype.inspect = function () {

@@ -74,3 +86,3 @@ return '<BigNum ' + this.toString(10) + '>';

BigNum.prototype[op] = function (num) {
if (num instanceof BigNum) {
if (BigNum.isBigNum(num)) {
return this['b'+op](num);

@@ -118,3 +130,3 @@ }

}
else if (mod instanceof BigNum) {
else if (BigNum.isBigNum(mod)) {
m = mod;

@@ -130,3 +142,3 @@ }

}
else if (num instanceof BigNum) {
else if (BigNum.isBigNum(num)) {
return this.bpowm(num, m);

@@ -142,3 +154,3 @@ }

}
else if (mod instanceof BigNum) {
else if (BigNum.isBigNum(mod)) {
m = mod;

@@ -154,3 +166,3 @@ }

}
else if (num instanceof BigNum) {
else if (BigNum.isBigNum(num)) {
return this.bmod(num, m);

@@ -207,3 +219,3 @@ }

BigNum.prototype.cmp = function (num) {
if (num instanceof BigNum) {
if (BigNum.isBigNum(num)) {
return this.bcompare(num);

@@ -251,3 +263,3 @@ }

BigNum.prototype[name] = function (num) {
if (num instanceof BigNum) {
if (BigNum.isBigNum(num)) {
return this['b' + name](num);

@@ -267,3 +279,3 @@ }

BigNum.prototype.root = function(num) {
if (num instanceof BigNum) {
if (BigNum.isBigNum(num)) {
return this.broot(num);

@@ -287,3 +299,3 @@ }

else {
var x = to instanceof BigNum
var x = BigNum.isBigNum(to)
? to.sub(this)

@@ -296,3 +308,3 @@ : BigNum(to).sub(this);

BigNum.prototype.invertm = function (mod) {
if (mod instanceof BigNum) {
if (BigNum.isBigNum(mod)) {
return this.binvertm(mod);

@@ -440,3 +452,3 @@ }

if (num instanceof BigNum) {
if (BigNum.isBigNum(num)) {
return num[name].apply(num, args);

@@ -443,0 +455,0 @@ }

{
"name": "bignum",
"version": "0.9.3",
"version": "0.10.0",
"description": "Arbitrary-precision integer arithmetic using OpenSSL",

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

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