MCPcopy Index your code
hub / github.com/python/mypy / compute_hash

Function compute_hash

mypy/build.py:2260–2266  ·  view source on GitHub ↗
(text: str)

Source from the content-addressed store, hash-verified

2258
2259
2260def compute_hash(text: str) -> str:
2261 # We use a crypto hash instead of the builtin hash(...) function
2262 # because the output of hash(...) can differ between runs due to
2263 # hash randomization (enabled by default in Python 3.3). See the
2264 # note in
2265 # https://docs.python.org/3/reference/datamodel.html#object.__hash__.
2266 return hash_digest(text.encode("utf-8"))
2267
2268
2269def write_cache(

Callers 2

write_cacheFunction · 0.90
get_sourceMethod · 0.85

Calls 2

hash_digestFunction · 0.90
encodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…