@dotenvup/secret-generator
v0.1.0
Published
MIT password and passphrase generator using Web Crypto (getRandomValues)
Maintainers
Readme
@dotenvup/secret-generator
Canonical source: github.com/sarhej/dotenvup (MIT DotEnvUp monorepo).
MIT-licensed client-side helpers for generating passwords and passphrases using Web Crypto (crypto.getRandomValues) with rejection sampling (no modulo bias).
Passphrases use the EFF Large Wordlist (CC0).
API
randomBytes(n)—Uint8Arrayof lengthnrandomUniformInt(maxExclusive)— uniform integer in[0, maxExclusive)generatePassword(options)— random stringgeneratePassphrase(options)— EFF-style passphraseestimatePasswordEntropyBits(length, charsetSize)estimatePassphraseEntropyBits(wordCount, wordlistSize?)DEFAULT_SYMBOLS,EFF_LARGE_WORDLIST_SIZE
Build
npm run buildProduces dist/index.js (single ESM bundle) for vendoring into static sites.
License
MIT. The bundled wordlist is from EFF (CC0); see EFF wordlist page.
