Skip to content

Instantly share code, notes, and snippets.

@martintrojer
Created January 24, 2014 14:17
Show Gist options
  • Save martintrojer/8598081 to your computer and use it in GitHub Desktop.
Save martintrojer/8598081 to your computer and use it in GitHub Desktop.
random-char-seq
(defn random-char-seq []
(let [digits (range 48 58)
lower-case (range 65 91)
upper-case(range 97 123)]
(repeatedly ƒ(rand-nth (map char (concat digits lower-case upper-case))))))
(apply str (take 60 (random-char-seq)))
=> "m9MSE2YVIZn8kjY6omvct7iQvOf1YMBILIOxsMcXguvN0uipqtvLcPvJXsTl"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment