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)
| 511 | return [a[1] for a in dfunctions] |
| 512 | |
| 513 | def 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 |
no test coverage detected
searching dependent graphs…