Skip to content

Instantly share code, notes, and snippets.

@SteveFromTheOffice
SteveFromTheOffice / IOTASeedGenerator.js
Last active October 10, 2019 19:48
Javascript IOTA Seed Generator
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.
@SteveFromTheOffice
SteveFromTheOffice / IOTASeedGenerator.ps1
Last active January 21, 2018 07:00
Powershell IOTA Seed Generator
## 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 = ""