Let us walk on the 3-isogeny graph
|
Public Member Functions | |
None | __init__ (self, Optional[Dict[str, List[str]]] hashes=None) |
"Hashes" | __and__ (self, "Hashes" other) |
int | digest_count (self) |
bool | is_hash_allowed (self, str hash_name, str hex_digest) |
None | check_against_chunks (self, Iterable[bytes] chunks) |
None | check_against_file (self, BinaryIO file) |
None | check_against_path (self, str path) |
bool | has_one_of (self, Dict[str, str] hashes) |
bool | __bool__ (self) |
bool | __eq__ (self, object other) |
int | __hash__ (self) |
Protected Member Functions | |
"NoReturn" | _raise (self, Dict[str, "_Hash"] gots) |
Protected Attributes | |
_allowed | |
A wrapper that builds multiple hashes at once and checks them against known-good values
:param hashes: A dict of algorithm names pointing to lists of allowed hex digests
Reimplemented in MissingHashes.
Definition at line 31 of file hashes.py.
References i.
Referenced by Protocol.__init_subclass__().
"Hashes" __and__ | ( | self, | |
"Hashes" | other | ||
) |
Definition at line 43 of file hashes.py.
References Hashes._allowed, and i.
bool __bool__ | ( | self | ) |
Return whether I know any known-good hashes.
Definition at line 115 of file hashes.py.
References Hashes._allowed.
bool __eq__ | ( | self, | |
object | other | ||
) |
Definition at line 119 of file hashes.py.
References Hashes._allowed, and i.
Referenced by Version.__ge__(), Version.__gt__(), Version.__le__(), Version.__ne__(), Matcher.__ne__(), Timestamp.__ne__(), and HTTPHeaderDict.__ne__().
int __hash__ | ( | self | ) |
Definition at line 124 of file hashes.py.
References Hashes._allowed.
Referenced by Style.__eq__(), and Style.__ne__().
|
protected |
Reimplemented in MissingHashes.
Definition at line 93 of file hashes.py.
References Hashes._allowed.
Referenced by Hashes.check_against_chunks().
None check_against_chunks | ( | self, | |
Iterable[bytes] | chunks | ||
) |
Check good hashes against ones built from iterable of chunks of data. Raise HashMismatch if none match.
Definition at line 70 of file hashes.py.
References Hashes._allowed, Hashes._raise(), MissingHashes._raise(), and i.
Referenced by Hashes.check_against_file().
None check_against_file | ( | self, | |
BinaryIO | file | ||
) |
Check good hashes against a file-like object Raise HashMismatch if none match.
Definition at line 96 of file hashes.py.
References Hashes.check_against_chunks().
Referenced by Hashes.check_against_path().
None check_against_path | ( | self, | |
str | path | ||
) |
Definition at line 104 of file hashes.py.
References Hashes.check_against_file().
int digest_count | ( | self | ) |
bool has_one_of | ( | self, | |
Dict[str, str] | hashes | ||
) |
Return whether any of the given hashes are allowed.
Definition at line 108 of file hashes.py.
References i, LinkHash.is_hash_allowed(), Link.is_hash_allowed(), and Hashes.is_hash_allowed().
bool is_hash_allowed | ( | self, | |
str | hash_name, | ||
str | hex_digest | ||
) |
Return whether the given hex digest is allowed.
Definition at line 66 of file hashes.py.
References Hashes._allowed.
Referenced by Hashes.has_one_of().
|
protected |
Definition at line 41 of file hashes.py.
Referenced by Hashes.__and__(), Hashes.__bool__(), Hashes.__eq__(), Hashes.__hash__(), Hashes._raise(), Hashes.check_against_chunks(), Hashes.digest_count(), and Hashes.is_hash_allowed().