UNPKG

entropy-string

Version:

Efficiently generate cryptographically strong random strings of specified entropy from various character sets.

9 lines (5 loc) 270 B
// Small ID with 1 in a million chance of repeat for 30 strings const { Entropy } = require('./entropy-string') const entropy = new Entropy() const string = entropy.smallID() console.log(`\n Small ID has 1 in a million chance of repeat for 30 strings: ${string}\n`)