password gen

Run Settings
LanguageClojure
Language Version
Run Command
(import java.security.SecureRandom) (def REGULAR_PASSWORD_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") (def PASSWORD_CHARS (str REGULAR_PASSWORD_CHARS "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ")) (defn generate-pw [len] (if (< len 0) (throw (new IllegalArgumentException "len is < 0"))) (def ran (new SecureRandom)) ;(def len-seq (range len)) ;(println len-seq)) (def password (new StringBuilder)) (dotimes [i len] (.append password (.charAt REGULAR_PASSWORD_CHARS (.nextInt ran (.length REGULAR_PASSWORD_CHARS))))) (.toString password) ) (println (generate-pw 15))
Editor Settings
Theme
Key bindings
Full width
Lines