Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lagenorhynque/7d9514dc4c37ba65b2a70b52943b75d1 to your computer and use it in GitHub Desktop.
Save lagenorhynque/7d9514dc4c37ba65b2a70b52943b75d1 to your computer and use it in GitHub Desktop.
(ns random-alphanumeric-generator)
(def alphanumeric "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890")
(defn rand-alphanumeric [len]
(repeatedly len #(rand-nth alphanumeric)))
(->> (repeatedly #(rand-alphanumeric 5))
(filter (fn [[a _ _ _ b]] (= a b)))
(map #(apply str %))
(take 10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment