use random.SystemRandom as random nr source (/dev/urandom)

/dev/urandom is somewhat better than python's PRNG

Change-Id: I6de38c14ac6dd55bc84d53974192509c18d02bfa
This commit is contained in:
Neels Hofmeyr
2025-08-05 00:20:21 +02:00
parent c9786fa72e
commit 93014f67ff

View File

@@ -124,7 +124,7 @@ class DecimalRangeSource(InputExpandingParamSource):
return "%0*d" % (self.num_digits, val) # pylint: disable=consider-using-f-string
class RandomSourceMixin:
random_impl = random # TODO secure random source?
random_impl = random.SystemRandom()
class RandomDigitSource(DecimalRangeSource, RandomSourceMixin):
"""return a different sequence of random decimal digits each"""