Hi,

I am trying to use the ExecuteScript Apache NiFi processor to decode some
hexadecimal binary data in 2's complement form, and I'd like to use a
relatively simple solution, but with python I ran into a strange bug.

The sample python code I tried to execute is the following:
import ctypes
ctypes.c_int16(int("e675", 16)).value

The value of this funciton call in a usual python interpreter is -6,539
(which I need, and according to the documentation is the correct return
value) but in the NiFi processor, it returns 58,977.

I know I could implement a function which does this job, but I'd like to
use it in more than one processor, and the simpler it is, the less buggy it
might get.

Regards,
Máté

Reply via email to