Skip to content

Instantly share code, notes, and snippets.

@eouw0o83hf
Last active August 29, 2015 14:09
Show Gist options
  • Save eouw0o83hf/5b87c167c8d8059f6030 to your computer and use it in GitHub Desktop.
Save eouw0o83hf/5b87c167c8d8059f6030 to your computer and use it in GitHub Desktop.
High-Entropy Memorable Password Generator
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