Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pip._internal.utils.hashes.Hashes Class Reference
Inheritance diagram for pip._internal.utils.hashes.Hashes:
Inheritance graph
[legend]

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
 

Detailed Description

A wrapper that builds multiple hashes at once and checks them against
known-good values

Constructor & Destructor Documentation

◆ __init__()

None pip._internal.utils.hashes.Hashes.__init__ (   self,
Optional[Dict[str, List[str]]]   hashes = None 
)
:param hashes: A dict of algorithm names pointing to lists of allowed
    hex digests

Reimplemented in pip._internal.utils.hashes.MissingHashes.

Member Function Documentation

◆ __bool__()

bool pip._internal.utils.hashes.Hashes.__bool__ (   self)
Return whether I know any known-good hashes.

◆ check_against_chunks()

None pip._internal.utils.hashes.Hashes.check_against_chunks (   self,
Iterable[bytes]  chunks 
)
Check good hashes against ones built from iterable of chunks of
data.

Raise HashMismatch if none match.

◆ check_against_file()

None pip._internal.utils.hashes.Hashes.check_against_file (   self,
BinaryIO  file 
)
Check good hashes against a file-like object

Raise HashMismatch if none match.

◆ has_one_of()

bool pip._internal.utils.hashes.Hashes.has_one_of (   self,
Dict[str, str]  hashes 
)
Return whether any of the given hashes are allowed.

◆ is_hash_allowed()

bool pip._internal.utils.hashes.Hashes.is_hash_allowed (   self,
str  hash_name,
str  hex_digest 
)
Return whether the given hex digest is allowed.

The documentation for this class was generated from the following file: