Cannot hash data larger than 2GB
pitrou opened this issue · comments
Antoine Pitrou commented
>>> xxhash.xxh64(b'x' * 2**30)
<xxhash.xxh64 at 0x7f8e528d14f0>
>>> xxhash.xxh64(b'x' * 2**31)
Traceback (most recent call last):
File "<ipython-input-31-0560f5d338db>", line 1, in <module>
xxhash.xxh64(b'x' * 2**31)
OverflowError: size does not fit in an int
Antoine Pitrou commented
The solution is to either use the s*
code instead of s#
in PyArg_ParseTuple(), or define the PY_SSIZET_CLEAN
macro and change size fields from int
to Py_ssize_t
. See https://docs.python.org/2.7/c-api/arg.html . I can also make a PR if you want.