Skip to content

Instantly share code, notes, and snippets.

@josephok
Created March 27, 2014 01:44
Show Gist options
  • Save josephok/9798227 to your computer and use it in GitHub Desktop.
Save josephok/9798227 to your computer and use it in GitHub Desktop.
Generate a random string with arbitrary length
random_string = (length) ->
id = ""
id += Math.random().toString(36).substr(2) while id.length < length
id.substr 0, length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment