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) => wishlist)īookmarklet javascript:prompt("Random Uint32Array(o))).map(o=>n).join(""))())Īom(crypto.randomFillSync(new Uint32Array(length)))Ĭhars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-" var generatePassword = (Īom(crypto.getRandomValues(new Uint32Array(length))) No while (true), no if/else, no declaration.īase on mwag's answer, but this one uses crypto.getRandomValues, a stronger random than Math.random. For someone who is looking for a simplest script.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |