MCPcopy Create free account
hub / github.com/numpy/numpy / fullapi_hash

Function fullapi_hash

numpy/core/code_generators/genapi.py:511–520  ·  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

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

Callers 1

cversions.pyFile · 0.90

Calls 3

order_dictFunction · 0.85
encodeMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected