I have been given some algorithms to reverse engineer. The algorithm below is a radix sort, but I am very confused about what is actually happening in the code.
I\'
A mask, or bitmask, is used to "turn off" every bit except those that are allowed to be "seen" through the mask. The 0
s filter out the bit they are AND
ed with, the 1
s allow the bit through. A common usage is to isolate a byte-sized portion of an integer data type:
00000000 11111111 00000000 00000000
& // Boolean AND
10010101 10010101 10010101 10010101
yields
00000000 10010101 00000000 00000000