MCPcopy
hub / github.com/python/mypy / hash_digest

Function hash_digest

mypy/util.py:572–579  ·  view source on GitHub ↗

Compute a hash digest of some data. We use a cryptographic hash because we want a low probability of accidental collision, but we don't really care about any of the cryptographic properties.

(data: bytes)

Source from the content-addressed store, hash-verified

570
571
572def hash_digest(data: bytes) -> str:
573 """Compute a hash digest of some data.
574
575 We use a cryptographic hash because we want a low probability of
576 accidental collision, but we don't really care about any of the
577 cryptographic properties.
578 """
579 return hashlib.sha1(data).hexdigest()
580
581
582def hash_digest_bytes(data: bytes) -> bytes:

Callers 6

take_module_snapshotFunction · 0.90
options_snapshotFunction · 0.90
compute_hashFunction · 0.90
readMethod · 0.90
report_config_dataMethod · 0.90
write_cacheFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…