create rng ouside loop & improve readme
This commit is contained in:
parent
2a033ecb81
commit
7ca991af07
@ -8,3 +8,5 @@ example output:
|
|||||||
```
|
```
|
||||||
retrace-choice-litter-dreamt-zipping
|
retrace-choice-litter-dreamt-zipping
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This project uses the [EFF's Wordlists for Random Passphrases](https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases) and [PCG random](https://www.pcg-random.org/) to pick random words
|
||||||
|
@ -45,10 +45,10 @@ int main(int argc, char *argv[]) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
pcg_extras::seed_seq_from<std::random_device> seed_source;
|
pcg_extras::seed_seq_from<std::random_device> seed_source;
|
||||||
pcg32 rng(seed_source);
|
pcg32 rng(seed_source);
|
||||||
|
|
||||||
|
for (int i = 0; i < count; i++) {
|
||||||
int random_int = std::uniform_int_distribution<int>(0, wordlist.size())(rng);
|
int random_int = std::uniform_int_distribution<int>(0, wordlist.size())(rng);
|
||||||
|
|
||||||
std::cout << wordlist[random_int];
|
std::cout << wordlist[random_int];
|
||||||
|
Loading…
Reference in New Issue
Block a user