No this is intentional. I have kept the original type from the util.cpp array type. It is signed and -1 as a special value to indicate not an hex char.

Let me rephrase the concern. As soon as the sign bit of an integer is on after doing bit manips, you have a negative number that will turn on more bits to 1 if you store the value into a bigger int type. think about -1.

Can't give a specific example of problem from that but I have the vague impression of having been bitten by that one in the past.

By having a signed char array, this let you use -1 as a reserved value (0 is valid) and minimize its size. By having the return type bigger (int16 or int) this protect you against having surprises from the sign bit when manipulating the result.

right now it is all theorical as the code is tested and works as expected. just highlighting the risk and propose a simple way to mitigate it.