UNPKG

entropy-string

Version:

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

8 lines (5 loc) 235 B
// Custom characters: Uppercase hex const { Entropy } = require('./entropy-string') const entropy = new Entropy({ charset: '0123456789ABCDEF', bits: 48 }) const string = entropy.string() console.log(`\n Uppercase hex: ${string}\n`)