Created
September 7, 2021 13:32
-
-
Save abachman/5b26466250ea89d69cb0ea8318dd42b0 to your computer and use it in GitHub Desktop.
passphrase generator
This file contains hidden or 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
#!/usr/bin/env ruby | |
# ws=open('/usr/share/dict/words').readlines.map(&:strip).select{|w|/^[a-z]{7}$/=~w};100.times{p ws.sample(6).join(' ')} | |
ws=open('/usr/share/dict/words').readlines.select {|w| | |
/^[a-z]{5,7}\b/ =~ w | |
}.map(&:strip) | |
def n | |
(rand() * 89 + 10).floor.to_s | |
end | |
CHARS = '!@#$%^&*(){}[]-_=+;:?/.,<>|'.chars | |
def s | |
CHARS.sample | |
end | |
100.times { | |
puts ws.sample(6).map {|w| w + n + s}.join() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment