I'm confused in bitmasks, bitflags, and other "bit" stuff.
I have a list of error codes - like [102, 104, 108, 80000000, 8000000, 10000000, 1000000, 0x0008000, ....]
. Part of it writing in system logs like bitflags, f.e. "67108864" (and part of them not, and return normal numbers). I need to match them, but I can not find any algorithm. How I can do that? Maybe it used only for codes like "0x0008000"? If it is true how to define which of this?
The problem is deeper. I do not understand byte flags. I understand that flags usually used for boolean states, but here is logged status codes. For example, 102 is (1100110)2. Byte flag for that number is 2+4+32+64 ... It is how I do transform int to binary form, and it is obviously equal 102. So I'm confused.
Thanks for your time!