OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, hashes=None) |
def | __and__ (self, other) |
def | digest_count (self) |
def | is_hash_allowed (self, hash_name, hex_digest) |
def | check_against_chunks (self, chunks) |
def | check_against_file (self, file) |
def | check_against_path (self, path) |
def | __nonzero__ (self) |
def | __bool__ (self) |
def | __eq__ (self, other) |
def | __hash__ (self) |
A wrapper that builds multiple hashes at once and checks them against known-good values
def __init__ | ( | self, | |
hashes = None |
|||
) |
:param hashes: A dict of algorithm names pointing to lists of allowed hex digests
def __and__ | ( | self, | |
other | |||
) |
def __bool__ | ( | self | ) |
def __eq__ | ( | self, | |
other | |||
) |
def __hash__ | ( | self | ) |
def __nonzero__ | ( | self | ) |
Return whether I know any known-good hashes.
def check_against_chunks | ( | self, | |
chunks | |||
) |
Check good hashes against ones built from iterable of chunks of data. Raise HashMismatch if none match.
def check_against_file | ( | self, | |
file | |||
) |
Check good hashes against a file-like object Raise HashMismatch if none match.
def check_against_path | ( | self, | |
path | |||
) |
def digest_count | ( | self | ) |
def is_hash_allowed | ( | self, | |
hash_name, | |||
hex_digest | |||
) |
Return whether the given hex digest is allowed.