c - regarding a line of code on bit operation -
how understand following lines of c# code in terms of bit operation
a = 15 & ( ^ (b << 3));
and bit operations in following segment of code, way declare uint8_t a
, uint8_t b
int decode(const void* raw_in, void* raw_out, uint32_t password, size_t len) { ## code here ## const uint8_t* in = (const uint8_t*)raw_in; uint32_t seed = password ^ 0x48879c19u; (size_t = 0 ; < len; ++i) { uint8_t = (in[i] << 4) ^ seed; uint8_t b = (((uint32_t)in[i]) << 7 ^ seed) >> 11; .......
a = 15 & ( ^ (b << 3)); | | | | | |_left shift (b's bits left shifted 3) | | | |_bitwise xor (a xor result of (b<<3) ) | |_ bitwise , ( 15 , result of above )
similarly >>
right shift operator
Comments
Post a Comment