Socket
Socket
Sign inDemoInstall

random-js

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

random-js - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

6

CHANGELOG.md

@@ -1,3 +0,7 @@

# 1.0.7 (2015-01-13)
# 1.0.8 (2015-10-13)
- add `getUseCount()` to the `mt19937` engine, which returns how many requests or discards have occurred.
# 1.0.7 (2015-10-13)
- the current time is now used in `Random.generateEntropyArray`

@@ -4,0 +8,0 @@

@@ -114,2 +114,3 @@ /*jshint eqnull:true*/

var index = 0;
var uses = 0;

@@ -124,5 +125,10 @@ function next() {

index = (index + 1) | 0;
uses += 1;
return temper(value) | 0;
}
next.getUseCount = function() {
return uses;
};
next.discard = function (count) {
uses += count;
if ((index | 0) >= 624) {

@@ -148,2 +154,3 @@ refreshData(data);

index = 624;
uses = 0;
return next;

@@ -150,0 +157,0 @@ };

2

package.json
{
"name": "random-js",
"description": "A mathematically correct random number generator library for JavaScript.",
"version": "1.0.7",
"version": "1.0.8",
"author": {

@@ -6,0 +6,0 @@ "name": "Cameron Kenneth Knight",

@@ -68,3 +68,6 @@ # Random.js

* `mt.discard(count)`: Discard `count` random values. More efficient than running `mt()` repeatedly.
* `mt.getUseCount()`: Return the number of times the engine has been used plus the number of discarded values.
One can seed a Mersenne Twister with the same value (`mt.seed(value)`) or values (`mt.seedWithArray(array)`) and discard the number of uses (`mt.getUseCount()`) to achieve the exact same state.
### Distributions

@@ -71,0 +74,0 @@

Sorry, the diff of this file is too big to display

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