Skip to content

Instantly share code, notes, and snippets.

@indrajithi
Created October 22, 2019 16:33
Show Gist options
  • Select an option

  • Save indrajithi/a040535009c256487f7280f4b8dffccb to your computer and use it in GitHub Desktop.

Select an option

Save indrajithi/a040535009c256487f7280f4b8dffccb to your computer and use it in GitHub Desktop.
Generate random strings in cojure
;; Create random string in clojure
(defn rand-str [len]
(apply str (take len (repeatedly #(char (+ (rand 26) 97))))))
;small
(defn rand-strB [len]
(apply str (take len (repeatedly #(char (+ (rand 26) 65))))))
;caps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment