Skip to content

Instantly share code, notes, and snippets.

@rcampbell
Created September 4, 2014 16:05
Show Gist options
  • Save rcampbell/213ee1a7ab490c576d3a to your computer and use it in GitHub Desktop.
Save rcampbell/213ee1a7ab490c576d3a to your computer and use it in GitHub Desktop.
Readable WPA2-PSK generator
(defn- char-range [start end]
(map char (range (int start)
(inc (int end)))))
(def ^:private
dirty
(char-range \! \~))
(def ^:private
clean
(remove #{\i \I \l \L \1 \| \0 \O \o \` \' \" \, \. \: \;}
dirty))
(defn sample
([] (sample 63)) ; WPA2 PSK ASCII key max length
([n]
(->> #(rand-nth clean)
repeatedly
(take n)
(apply str))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment