MCPcopy Index your code
hub / github.com/numpy/numpy / fullapi_hash

Function fullapi_hash

numpy/_core/code_generators/genapi.py:513–526  ·  view source on GitHub ↗

Given a list of api dicts defining the numpy C API, compute a checksum of the list of items in the API (as a string).

(api_dicts)

Source from the content-addressed store, hash-verified

511 return [a[1] for a in dfunctions]
512
513def fullapi_hash(api_dicts):
514 """Given a list of api dicts defining the numpy C API, compute a checksum
515 of the list of items in the API (as a string)."""
516 a = []
517 for d in api_dicts:
518 d = d.copy()
519 d.pop("__unused_indices__", None)
520 for name, data in order_dict(d):
521 a.extend(name)
522 a.extend(','.join(map(str, data)))
523
524 return hashlib.md5(
525 ''.join(a).encode('ascii'), usedforsecurity=False
526 ).hexdigest()
527
528
529# To parse strings like 'hex = checksum' where hex is e.g. 0x1234567F and

Callers 1

cversions.pyFile · 0.90

Calls 4

order_dictFunction · 0.85
joinMethod · 0.80
encodeMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…