Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "rc4", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "RC4 random number generator", | ||
@@ -5,0 +5,0 @@ "main": "rc4.js", |
@@ -17,3 +17,8 @@ "use strict"; | ||
function seed(key) { | ||
if (typeof key === "string") { | ||
if (key === undefined) { | ||
key = new Array(N); | ||
for (var k = 0; k < N; k++) { | ||
key[k] = Math.floor(Math.random() * N); | ||
} | ||
} else if (typeof key === "string") { | ||
// to string | ||
@@ -20,0 +25,0 @@ key = "" + key; |
@@ -16,2 +16,3 @@ # rc4 | ||
var generator = new RC4("my seed"); // string or array of integers | ||
// without the seed RNG is seeded with random data from Math.random | ||
@@ -18,0 +19,0 @@ // byte := integer ∈ [0, 255] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8345
154
57