0

I get a (hex) value from an API, which is combined with some OR operations:

The ReferenceStatus is used to report the references stored for one person in the ID Module archive. If more than one reference is available, the approbriate values are combined with an OR operation.

This is the table with the different (non-combined) values:

Value  Remark
0x0001 Left little finger
0x0002 Left ring finger
0x0004 Left middle finger
0x0008 Left index finger
0x0010 Left thumb
0x0020 Right thumb
0x0040 Right index finger
0x0080 Right middle finger
0x0100 Right ring finger
0x0200 Right little finger
0x03FF All fingers

How can I split up the value from the API (let's say it's 0x01C8) into it the different codes (0x0008, 0x0040, 0x0080, 0x0100)? (I never worked with bitwise operations before)

Cheesi
  • 483
  • 4
  • 14

0 Answers0