This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## CURRENTLY IN TESTING, DO NOT USE! ## | |
$len = 81 | |
$chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ9" | |
$bytes = new-object "System.Byte[]" $len | |
$rnd = new-object System.Security.Cryptography.RNGCryptoServiceProvider | |
$rnd.GetBytes($bytes) | |
$result = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var GenerateSeed = function () { | |
var length = 81; // The length of the seed and int array. | |
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ9"; // The allowed characters in the seed. | |
var randomValues = new Uint32Array(length); // An empty array to store the random values. | |
var result = new Array(length); // An empty array to store the seed characters. | |
window.crypto.getRandomValues(randomValues); // Generate random values and store them to array. | |
var cursor = 0; // A cursor is introduced to remove modulus bias. |