64-bit integers in Cython

I am trying to link a C ++ library (pHash) with Python using Cython, but I am having problems with some types. The library functions use "unsigned long long", and I cannot find a way to declare variables and parameters with this type. I was looking for a list of types that I can use with cdef, but didn't find anything. Can someone point me to such a list (if one exists) or otherwise suggest a way to use 64-bit types in Cython? Thanks.

+4
source share
2 answers

Here is one of my answers using unsigned long long with cython

Python simple task: fast bitwise XOR for data buffers

+3
source

I could use both unsigned long long and long long just fine with cdef. See for example my answer to this question here . I just tried using the same code there as an unsigned long long instead of a long long , and it worked fine. Can you clarify what problems you have with these types? Maybe you can post some kind of source code that doesn't work for you?

+4
source

Source: https://habr.com/ru/post/1312492/


All Articles