Created
September 4, 2014 16:05
-
-
Save rcampbell/213ee1a7ab490c576d3a to your computer and use it in GitHub Desktop.
Readable WPA2-PSK generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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