Random hash length from truncated hash length

pull/76/head
Mark Qvist 2022-04-20 13:08:21 +02:00
rodzic 38aeb1ab3b
commit 402b5fc461
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -180,7 +180,7 @@ class Identity:
:param data: Data to be hashed as *bytes*.
:returns: Truncated SHA-256 hash of random data as *bytes*
"""
return Identity.truncated_hash(os.urandom(10))
return Identity.truncated_hash(os.urandom(Identity.TRUNCATED_HASHLENGTH//8))
@staticmethod
def validate_announce(packet):