![]() assumes that crypto.getRandomValues and Array.fill() are both available.it uses only native Javascript- no installation or other libs required.it's more concise than other answers (for general solution, 3 lines max can be one-liner) (OK well, sort of depending on how much you squint your eyes looking at a "line").it's more secure than accepted/highest-voted answer, and also more versatile, because first, it supports any case-sensitive character (including any of the ~150k (at the time of this writing) unicode chars, rather than just one of 36 case-insensitive alphanumeric ones), and second, it uses a secure random generator that is applied uniformly.Anyway, fwiw this update addresses both, which I don't believe any other answer does. Many other answers berate the use of Math.random() and then go on to use a better random number generator that is non-uniformly applied, with an end result that (just like using Math.random!) is not cryptographically secure. ![]() Many answers (including the original of this one) don't actually answer the letter- and number-count requirements of the OP.īelow are two solutions: general (no min letters/numbers), and with rules as specified in the OP. map((x) => characters)īookmarklet javascript:prompt("Random Uint32Array(o))).map(o=>n).join(""))())Īom(crypto.randomFillSync(new Uint32Array(length))) var generatePassword = (Īom(crypto.getRandomValues(new Uint32Array(length))) ![]() If you're looking for a straightforward generator, consider these options:īased on mwag's answer, this one utilizes crypto.getRandomValues, which provides a stronger randomization than Math.random. You can find the password generation function in bitwarden/. Instead, consider referring to open-source password generators, like Bitwarden, which is also a password manager. Various other trademarks are held by their respective owners.If you need to generate passwords for end-users, avoid relying on answers from Stackoverflow or ID generator. WatchGuard and the WatchGuard logo are registered trademarks or trademarks of WatchGuard Technologies in the United States and other countries.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |