Skip to content

Instantly share code, notes, and snippets.

@apaatsio
Last active October 11, 2015 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apaatsio/3775643 to your computer and use it in GitHub Desktop.
Save apaatsio/3775643 to your computer and use it in GitHub Desktop.
password generating function
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