Improve asset in get_permutated_index

This commit is contained in:
Paul Hauner 2019-02-15 12:50:56 +11:00 committed by GitHub
parent 267f840570
commit 2f327f36d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -745,7 +745,7 @@ def get_permuted_index(index: int, list_size: int, seed: Bytes32) -> int:
See the 'generalized domain' algorithm on page 3. See the 'generalized domain' algorithm on page 3.
""" """
assert index < list_size assert index < list_size
assert list_size < 2**24 assert list_size <= 2**24
for round in range(SHUFFLE_ROUND_COUNT): for round in range(SHUFFLE_ROUND_COUNT):
pivot = bytes_to_int(hash(seed + int_to_bytes1(round))[0:8]) % list_size pivot = bytes_to_int(hash(seed + int_to_bytes1(round))[0:8]) % list_size