aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-04-30 14:35:18 -0400
committerAva Chow <github@achow101.com>2024-08-14 13:20:22 -0400
commitd2465dfac68f96ffdaad88a0bd4891ed37cbfdfc (patch)
treec35a100378b7eaf392a71908e61f48ac2f8f602d /contrib
parentaf550b3a0fd406f175f197ea9867b41ff4e97af4 (diff)
makeseeds: Shuffle ips after parsing
The crawlers are not guaranteed to output nodes in a random order, so shuffle the ips list after parsing to break any biasing that may be caused by the output order.
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/seeds/makeseeds.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/seeds/makeseeds.py b/contrib/seeds/makeseeds.py
index 44251e059b..a8bf00f762 100755
--- a/contrib/seeds/makeseeds.py
+++ b/contrib/seeds/makeseeds.py
@@ -10,6 +10,7 @@ import argparse
import collections
import ipaddress
from pathlib import Path
+import random
import re
import sys
from typing import Union
@@ -211,6 +212,7 @@ def main():
with open(args.seeds, 'r', encoding='utf8') as f:
lines = f.readlines()
ips = [parseline(line) for line in lines]
+ random.shuffle(ips)
print('Done.', file=sys.stderr)
print('\x1b[7m IPv4 IPv6 Onion I2P CJDNS Pass \x1b[0m', file=sys.stderr)