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

arcticfox-encryption

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arcticfox-encryption - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

default-p10.afc

30

index.js
// https://github.com/dotnet/coreclr/blob/master/src/inc/random.h
// http://referencesource.microsoft.com/#mscorlib/system/random.cs
const INT32MIN = -0x80000000;
const INT32MAX = 0x7FFFFFFF;
const MSEED = 161803398;
const MBIG = INT32MAX;
class DotNetRandom {
constructor(seed) {
this.MSEED = 161803398;
this.MBIG = 2147483647;
this.SeedArray = new Array(55).fill(0);

@@ -12,6 +18,5 @@

const subtraction = (seed === -2147483648) ? this.MBIG : Math.abs(seed);
const substraction = (seed === INT32MIN) ? INT32MAX : Math.abs(seed);
mj = MSEED - substraction;
mj = this.MSEED - subtraction;
this.SeedArray[55] = mj;

@@ -25,3 +30,3 @@

if (mk < 0) {
mk += this.MBIG;
mk += MBIG;
}

@@ -34,5 +39,5 @@ mj = this.SeedArray[ii];

/* eslint-disable no-mixed-operators */
this.SeedArray[i] -= this.SeedArray[1 + (i + 30) % 55];
this.SeedArray[i] = (this.SeedArray[i] - this.SeedArray[1 + (i + 30) % 55]) & 0xFFFFFFFF;
if (this.SeedArray[i] < 0) {
this.SeedArray[i] += this.MBIG;
this.SeedArray[i] += MBIG;
}

@@ -59,7 +64,7 @@ }

if (retVal === this.MBIG) {
if (retVal === MBIG) {
retVal--;
}
if (retVal < 0) {
retVal += this.MBIG;
retVal += MBIG;
}

@@ -77,5 +82,3 @@

for (let i = 0; i < buf.length; i++) {
const c = this.internalSample() % 256;
// Console.log(c);
buf[i] = c;
buf[i] = this.internalSample() % 256;
}

@@ -103,2 +106,3 @@ }

const table = this.createTable(initialKey);
const result = Buffer.alloc(buf.length - keyBytes.length);

@@ -105,0 +109,0 @@

{
"name": "arcticfox-encryption",
"version": "1.0.0",
"version": "1.0.1",
"description": "Encode and Decode ArcticFox Config Files (.afc)",
"main": "index.js",
"scripts": {
"test": "camo-purge ; xo --space 4 --ignore test.js && mocha test.js"
"test": "camo-purge ; xo --space 4 --ignore test.js && mocha test.js",
"testonly": "mocha test.js"
},

@@ -13,2 +14,6 @@ "repository": {

},
"engines": {
"node": ">=6.0.0"
},
"engineStrict": true,
"keywords": [

@@ -30,7 +35,7 @@ "vape",

"devDependencies": {
"camo-purge": "^1.0.2",
"mocha": "^3.4.2",
"should": "^11.2.1",
"xo": "^0.18.2"
"camo-purge": "latest",
"mocha": "latest",
"should": "latest",
"xo": "latest"
}
}

@@ -27,3 +27,3 @@ # arcticfox-encryption

* https://github.com/hobbyquaker/arcticfox - a Node module that abstracts the HID communication with the Arcticfox
firmware and is also used by this project.
firmware.

@@ -30,0 +30,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