Check if uint16_t contains binary uin8_t
Suppose I have two bytes, 0xE1 and 0xE6. These consecutive bytes where cut
from a longer range of bits. Since the cutting point is not related to the
actual byte values, I need to check whether these bytes contain another,
say 0x3C. Basically a binary string contains.
0xE1 0xE6
1110000111100110
00111100 // It matches!
0x3C
How do I algorithmically test this?
No comments:
Post a Comment