Last active
August 29, 2015 14:09
-
-
Save eouw0o83hf/5b87c167c8d8059f6030 to your computer and use it in GitHub Desktop.
High-Entropy Memorable Password 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
const int WordCount = 7; | |
const int MinLength = 3; | |
const int MaxLength = 8; | |
void Main() | |
{ | |
var parsed = words | |
.Split('\n') | |
.Select(a => a.Trim()) | |
.Where(a => a.Length >= MinLength && a.Length <= MaxLength) | |
.ToList(); | |
var random = new Random(); | |
var output = Enumerable.Range(0, WordCount) | |
.Select(a => parsed[random.Next(parsed.Count)]); | |
Console.WriteLine(string.Join(" ", output)); | |
} | |
const string words = | |
@" | |
line | |
separated | |
list | |
of | |
words | |
i | |
put | |
the | |
entire | |
dictionary | |
here | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment