Debian Codegraph @

src/cython/_compreffor.pyx

raw
1 from libc.stdint cimport uint32_t
2
3
4 cdef extern from "../cxx/cffCompressor.h":
5 uint32_t* _compreff "compreff" (
6 unsigned char* dataStream, int numRounds,
7 unsigned& outputLength) except +
8 void unload(uint32_t* response)
9
10
11 def compreff(bytes dataStream, int numRounds):
12 cdef unsigned outputLength = 0
13 cdef uint32_t* raw_output = _compreff(dataStream, numRounds, outputLength)
14 cdef list output = []
15 cdef unsigned i
16 for i in range(outputLength):
17 output.append(raw_output[i])
18 if raw_output != NULL:
19 unload(raw_output)
20 return output