https://github.com/dchest/generatepassword-js
Random password generator in JavaScript for browsers
https://github.com/dchest/generatepassword-js
Last synced: 8 months ago
JSON representation
Random password generator in JavaScript for browsers
- Host: GitHub
- URL: https://github.com/dchest/generatepassword-js
- Owner: dchest
- Created: 2014-04-11T16:42:44.000Z (about 12 years ago)
- Default Branch: gh-pages
- Last Pushed: 2014-04-11T17:12:13.000Z (about 12 years ago)
- Last Synced: 2025-03-18T02:24:53.730Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://dchest.github.io/generatepassword-js/
- Size: 137 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Safe pseudorandom password generator in JavaScript
==================================================
Uses [sjcl](https://github.com/bitwiseshiftleft/sjcl)'s random number
generator, which is based on Fortuna and is seeded with
window.crypto.getRandomValues on modern browsers and DOM events on old
browsers. (We could use just window.crypto.getRandomValues if we didn't have to
support older browsers, but such is life.)
Generates passwords using this alphabet:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_@
which contains 64 characters (if you want to modify the alphabet, take care not
to introduce modulo bias -- use alphabet lengths which are power of two).
Example
-------
generatePassword(16) // => "depaThWbS3En_FEb"
Public domain dedication
------------------------
Written in 2014 by Dmitry Chestnykh
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty. You should have
received a copy of the CC0 Public Domain Dedication along with this software.
If not, see .
SJCL (included sjcl.min.js) has its own license (dual-licensed: BSD or GPL2):
https://github.com/bitwiseshiftleft/sjcl/blob/master/README/COPYRIGHT