use stdint.h: fixes crash on 64bit architecture
replace char to signed char: char signedness is undefined by default and it is unsigned on ARM