import sys
import os
-import string
# invert binary string
def invert(data):
# do the actual search
def search(target,data):
- location= string.find(data,target)
+ location = data.find(target)
if location >= 0:
print '*** Match at bit %d:' % location,
print '%s<%s>%s' % (data[:location],target,data[location+len(target):])
return data[::-1]
# match forward, backward and inverted
-def domatch(number,binary):
+def domatch(binary,number):
reversed= stringreverse(number)
inverted= invert(binary)