| 1611 | |
| 1612 | #if PY_VERSION_HEX < 0x030E00A0 |
| 1613 | static inline Py_hash_t Py_HashBuffer(const void *ptr, Py_ssize_t len) |
| 1614 | { |
| 1615 | #if PY_VERSION_HEX >= 0x03000000 && !defined(PYPY_VERSION) |
| 1616 | PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void *src, Py_ssize_t len); |
| 1617 | |
| 1618 | return _Py_HashBytes(ptr, len); |
| 1619 | #else |
| 1620 | Py_hash_t hash; |
| 1621 | PyObject *bytes = PyBytes_FromStringAndSize((const char*)ptr, len); |
| 1622 | if (bytes == NULL) { |
| 1623 | return -1; |
| 1624 | } |
| 1625 | hash = PyObject_Hash(bytes); |
| 1626 | Py_DECREF(bytes); |
| 1627 | return hash; |
| 1628 | #endif |
| 1629 | } |
| 1630 | #endif |
| 1631 | |
| 1632 |
nothing calls this directly
no outgoing calls
no test coverage detected