From 2c2e3f8ca40b97c9959b5e424cbf69cde53384cf Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 16 Aug 2023 16:32:42 +0000 Subject: [PATCH] util.randrange: expand docstring --- electrum/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/electrum/util.py b/electrum/util.py index acfd1f220..9a12d968b 100644 --- a/electrum/util.py +++ b/electrum/util.py @@ -1724,7 +1724,9 @@ def resolve_dns_srv(host: str): def randrange(bound: int) -> int: """Return a random integer k such that 1 <= k < bound, uniformly - distributed across that range.""" + distributed across that range. + This is guaranteed to be cryptographically strong. + """ # secrets.randbelow(bound) returns a random int: 0 <= r < bound, # hence transformations: return secrets.randbelow(bound - 1) + 1