MCPcopy
hub / github.com/pex-tool/pex / hash

Method hash

pex/util.py:74–80  ·  view source on GitHub ↗

Return the digest of a single file in a memory-efficient manner.

(cls, path, digest=None, hasher=sha1)

Source from the content-addressed store, hash-verified

72class CacheHelper(object):
73 @classmethod
74 def hash(cls, path, digest=None, hasher=sha1):
75 # type: (Text, Optional[Hasher], Callable[[], Hasher]) -> str
76 """Return the digest of a single file in a memory-efficient manner."""
77 if digest is None:
78 digest = hasher()
79 hashing.file_hash(path, digest)
80 return digest.hexdigest()
81
82 @classmethod
83 def pex_code_hash(

Callers 15

_fingerprint_fileFunction · 0.80
_add_distMethod · 0.80
repacked_whlFunction · 0.80
createMethod · 0.80
ensure_scienceFunction · 0.80
resolve_run_specMethod · 0.80
_fetchFunction · 0.80
ensure_pexrcFunction · 0.80
buildMethod · 0.80
_fingerprint_distFunction · 0.80
_install_wheelFunction · 0.80

Calls 1

hexdigestMethod · 0.45

Tested by 12

test_hashFunction · 0.64
test_lock_single_targetFunction · 0.64
test_corrupt_artifactFunction · 0.64
test_resolve_wheel_filesFunction · 0.64
create_indexFunction · 0.64
create_packageFunction · 0.64
create_lockFunction · 0.64