UNPKG

entropy-string

Version:

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

9 lines (5 loc) 219 B
// 128 bit const { Entropy, charset64 } = require('./entropy-string') const entropy = new Entropy({ charset: charset64 }) const string = entropy.sessionID() console.log(`\n 128-bit entropy session ID: ${string}\n`)