4 ms·
Can never turn down an opportunity for a one-liner. $ perl -E 'open(my $fh, "<", "/usr/share/dict/words"); my @words = map {chomp; $_} <$fh>; close $fh; say
by srollyson 13y ago
Can never turn down an opportunity for a one-liner.
$ perl -E 'open(my $fh, "<", "/usr/share/dict/words"); my @words = map {chomp; $_} <$fh>; close $fh; say join " ", map {$words[int rand @words]} 1..4'
menu chemists administrative seeps
Might have to run it a couple of times before you get something that you can memorize.
- giovannibajo1 13y agoYou shouldn't use a non-cryptographically secure random number generator (perl's rand) in the context of password generation. It's too risky.
- keenerd 13y agoEw. shuf -n 4 /usr/share/dict/words | tr -dc 'A-Za-z0-9'
- idProQuo 13y agoYou can use a dictionary of the most common 10000 words, you'd still have loads of entropy.