You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.
Implement a small C program that reads binary data from stdin and looks for a given, arbitrary-length bit pattern in it. The bit pattern and length are input as command-line arguments. The program does not produce any output (apart from usage and possible error messages). If the bit pattern is detected, the program exits with 0. Otherwise, it exits with 1.
The command takes two command-line arguments:
1. A sequence of hexadecimal digits representing the bit pattern.
2. A base-10 unsigned integer indicating the number of interesting bits
in the bit pattern.
Implementation notes:
- Isolate bit-pattern matching functionality into a separate library. Provide both static and dynamic library implementations
- Provide C & C++ API's for the library
Example:
$ # look for 1111 1000 110 in the input
$ echo 'h>0?' | ./bitmatch f8c 11 || echo not found
$ echo 'h<0?' | ./bitmatch f8c 11 || echo not found