There is a pseudo - random number generator outputs(one byte) a certain combination on the algorithm:
bytes = ("%02x" % (algo)) sys.stdout.write(bytes)
Question: how to implement "search" for a specific combination of bytes?
For example, the output of the generator - a1b2c3d4e5f6, and we need to stop the program if in the generation process will appear exactly the bytes specified d4e5 ('d4', followed immediately 'e5').
One byte is clear:
if bytes == 'd4': exit(0)
But if the first value is valid, then how about checking a second (third, fourth, etc.), immediately after it?