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

pure-rand

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pure-rand - npm Package Compare versions

Comparing version 5.0.0-experimental.4.1.2.0 to 5.0.0-experimental.4.1.2.1

22

lib/esm/generator/XoroShiro.js

@@ -15,12 +15,20 @@ var XoroShiro128Plus = (function () {

XoroShiro128Plus.prototype.next = function () {
var nextRng = new XoroShiro128Plus(this.s01, this.s00, this.s11, this.s10);
var out = nextRng.unsafeNext();
return [out, nextRng];
};
XoroShiro128Plus.prototype.unsafeNext = function () {
var out = (this.s00 + this.s10) | 0;
var a0 = this.s10 ^ this.s00;
var a1 = this.s11 ^ this.s01;
var ns00 = (this.s00 << 24) ^ (this.s01 >>> 8) ^ a0 ^ (a0 << 16);
var ns01 = (this.s01 << 24) ^ (this.s00 >>> 8) ^ a1 ^ ((a1 << 16) | (a0 >>> 16));
var ns10 = (a1 << 5) ^ (a0 >>> 27);
var ns11 = (a0 << 5) ^ (a1 >>> 27);
return [(this.s00 + this.s10) | 0, new XoroShiro128Plus(ns01, ns00, ns11, ns10)];
var s00 = this.s00;
var s01 = this.s01;
this.s00 = (s00 << 24) ^ (s01 >>> 8) ^ a0 ^ (a0 << 16);
this.s01 = (s01 << 24) ^ (s00 >>> 8) ^ a1 ^ ((a1 << 16) | (a0 >>> 16));
this.s10 = (a1 << 5) ^ (a0 >>> 27);
this.s11 = (a0 << 5) ^ (a1 >>> 27);
return out;
};
XoroShiro128Plus.prototype.jump = function () {
var rngRunner = this;
var rngRunner = new XoroShiro128Plus(this.s01, this.s00, this.s11, this.s10);
var ns01 = 0;

@@ -39,3 +47,3 @@ var ns00 = 0;

}
rngRunner = rngRunner.next()[1];
rngRunner.unsafeNext();
}

@@ -42,0 +50,0 @@ }

@@ -10,4 +10,4 @@ import { generateN, skipN } from './generator/RandomGenerator.js';

var __type = 'module';
var __version = '5.0.0-experimental.4.1.2.0';
var __commitHash = 'dba3431a7ecc95f2d2def4c250460482d5fb7844';
var __version = '5.0.0-experimental.4.1.2.1';
var __commitHash = 'e840bb8f83347a977dea31974e0515d5f9082887';
export { __type, __version, __commitHash, generateN, skipN, congruential, congruential32, mersenne, xorshift128plus, xoroshiro128plus, uniformArrayIntDistribution, uniformBigIntDistribution, uniformIntDistribution, };

@@ -18,12 +18,20 @@ "use strict";

XoroShiro128Plus.prototype.next = function () {
var nextRng = new XoroShiro128Plus(this.s01, this.s00, this.s11, this.s10);
var out = nextRng.unsafeNext();
return [out, nextRng];
};
XoroShiro128Plus.prototype.unsafeNext = function () {
var out = (this.s00 + this.s10) | 0;
var a0 = this.s10 ^ this.s00;
var a1 = this.s11 ^ this.s01;
var ns00 = (this.s00 << 24) ^ (this.s01 >>> 8) ^ a0 ^ (a0 << 16);
var ns01 = (this.s01 << 24) ^ (this.s00 >>> 8) ^ a1 ^ ((a1 << 16) | (a0 >>> 16));
var ns10 = (a1 << 5) ^ (a0 >>> 27);
var ns11 = (a0 << 5) ^ (a1 >>> 27);
return [(this.s00 + this.s10) | 0, new XoroShiro128Plus(ns01, ns00, ns11, ns10)];
var s00 = this.s00;
var s01 = this.s01;
this.s00 = (s00 << 24) ^ (s01 >>> 8) ^ a0 ^ (a0 << 16);
this.s01 = (s01 << 24) ^ (s00 >>> 8) ^ a1 ^ ((a1 << 16) | (a0 >>> 16));
this.s10 = (a1 << 5) ^ (a0 >>> 27);
this.s11 = (a0 << 5) ^ (a1 >>> 27);
return out;
};
XoroShiro128Plus.prototype.jump = function () {
var rngRunner = this;
var rngRunner = new XoroShiro128Plus(this.s01, this.s00, this.s11, this.s10);
var ns01 = 0;

@@ -42,3 +50,3 @@ var ns00 = 0;

}
rngRunner = rngRunner.next()[1];
rngRunner.unsafeNext();
}

@@ -45,0 +53,0 @@ }

@@ -24,5 +24,5 @@ "use strict";

exports.__type = __type;
var __version = '5.0.0-experimental.4.1.2.0';
var __version = '5.0.0-experimental.4.1.2.1';
exports.__version = __version;
var __commitHash = 'dba3431a7ecc95f2d2def4c250460482d5fb7844';
var __commitHash = 'e840bb8f83347a977dea31974e0515d5f9082887';
exports.__commitHash = __commitHash;
{
"name": "pure-rand",
"version": "5.0.0-experimental.4.1.2.0",
"version": "5.0.0-experimental.4.1.2.1",
"description": " Pure random number generator written in TypeScript",

@@ -22,3 +22,3 @@ "type": "commonjs",

"format:check": "prettier --list-different \"**/*.{js,ts}\"",
"format:fix": "prettier --write \"**/*.{js,ts}\"",
"format": "prettier --write \"**/*.{js,ts}\"",
"build": "tsc && tsc -p ./tsconfig.declaration.json",

@@ -47,6 +47,6 @@ "build:esm": "tsc --module es2015 --outDir lib/esm --moduleResolution node && cp package.esm-template.json lib/esm/package.json",

"@types/jest": "^26.0.4",
"@types/node": "^14.0.13",
"@types/node": "^15.0.0",
"benchmark": "^2.1.4",
"chalk": "^4.1.0",
"console-table-printer": "2.7.5",
"console-table-printer": "2.9.0",
"cross-env": "^7.0.3",

@@ -57,9 +57,9 @@ "fast-check": "^2.7.0",

"microtime": "^3.0.0",
"prettier": "2.2.1",
"prettier": "2.3.0",
"replace-in-file": "^6.1.0",
"source-map-support": "^0.5.16",
"ts-jest": "^26.1.2",
"ts-node": "^9.0.0",
"ts-node": "^10.0.0",
"typescript": "^4.0.2",
"yargs": "^16.0.3"
"yargs": "^17.0.1"
},

@@ -66,0 +66,0 @@ "keywords": [

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