A nibble is a four bit binary. As such you need three nibbles to represent 12A
.
The arr
you have there is incorrect - as there is no 2
in binary.
arr[0]=0001
arr[1]=0010
arr[2]=1010
For c# implementation see - How can you nibble (nybble) bytes in C#?