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

@navpreetdevpuri/base-2-n

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@navpreetdevpuri/base-2-n - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

19

lib/index.js

@@ -58,6 +58,7 @@ var Base2N = /** @class */ (function () {

carry = 1;
continue;
}
result[i] = this.digits[i] - carry - other.digits[i];
carry = 0;
else {
result[i] = this.digits[i] - carry - other.digits[i];
carry = 0;
}
}

@@ -71,4 +72,10 @@ return new Base2N(result, this.n, this.maxNoOfDigits);

var curr = this.digits[i] + other.digits[i] + carry;
carry = curr > this.base ? 1 : 0;
result[i] = curr;
if (curr > this.base) {
result[i] = curr - this.base;
carry = 1;
}
else {
result[i] = curr;
carry = 0;
}
}

@@ -82,3 +89,3 @@ return new Base2N(result, this.n, this.maxNoOfDigits);

var curr = (this.digits[i] >> 1) | (carry << 15);
carry = curr & 1 ? 1 : 0;
carry = curr & 1;
result[i] = curr;

@@ -85,0 +92,0 @@ }

{
"name": "@navpreetdevpuri/base-2-n",
"version": "1.0.1",
"version": "1.0.2",
"description": "To work with base 2^n numbers",

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

@@ -79,6 +79,6 @@ class Base2N {

carry = 1;
continue;
} else {
result[i] = this.digits[i] - carry - other.digits[i];
carry = 0;
}
result[i] = this.digits[i] - carry - other.digits[i];
carry = 0;
}

@@ -93,4 +93,9 @@ return new Base2N(result, this.n, this.maxNoOfDigits);

const curr = this.digits[i] + other.digits[i] + carry;
carry = curr > this.base ? 1 : 0;
result[i] = curr;
if (curr > this.base) {
result[i] = curr - this.base;
carry = 1;
} else {
result[i] = curr;
carry = 0;
}
}

@@ -105,3 +110,3 @@ return new Base2N(result, this.n, this.maxNoOfDigits);

const curr = (this.digits[i] >> 1) | (carry << 15);
carry = curr & 1 ? 1 : 0;
carry = curr & 1;
result[i] = curr;

@@ -108,0 +113,0 @@ }

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