UNPKG

entropy-string

Version:

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

11 lines (8 loc) 197 B
"use strict"; var Crypto = require('crypto'); var csprngBytes = function csprngBytes(count) { return Buffer.from(Crypto.randomBytes(count)); }; module.exports = { csprngBytes: csprngBytes };