Last active
October 11, 2015 00:38
-
-
Save apaatsio/3775643 to your computer and use it in GitHub Desktop.
password generating function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
generatePassword = (length) -> | |
# similar looking characters have been removed (e.g. letter l(L) and number 1) | |
allowedChars = "acdefghjkmnpqrstuvwxyzCDEFGHJKLMNPQRTUVWXY3679-+?@" | |
password = "" | |
for [1..length] | |
password += allowedChars[Math.floor(Math.random() * allowedChars.length)] | |
password |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment