I have a conversion problem in C#. Basically, I’m trying to convert an integer to bytes so that we only use the low 4 bits. Example 255 = 0F 0F or:
0xpqrs = 0p 0q 0r 0s
5*16*16*16 + 1*16*16 + 15*16 + 1 = 05 01 0f 01
How do I implement this in C#?
int => bytes:
bytes => int: