NICMx / FORT-validator

RPKI cache validator
MIT License
47 stars 22 forks source link

Generate all permutations of the list with equal probability #141

Closed job closed 6 days ago

job commented 2 weeks ago

@botovq was kind enough to point out that although my earlier implementation produced random-ish ordering, it strictly speaking wasn't Fisher-Yates.

We need to ensure j is a random number between i and list.count see the second example in the 'Modern Algorithm' https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle