mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-02-24 15:44:47 +08:00
simplified findbits.invert()
This commit is contained in:
parent
683f4a90ab
commit
9f975d42e8
1 changed files with 1 additions and 9 deletions
|
@ -26,15 +26,7 @@ import string
|
||||||
|
|
||||||
# invert binary string
|
# invert binary string
|
||||||
def invert(data):
|
def invert(data):
|
||||||
i= 0
|
return ''.join('0' if c == '1' else '1' for c in data)
|
||||||
out= ''
|
|
||||||
while(i < len(data)):
|
|
||||||
if data[i] == '0':
|
|
||||||
out += '1'
|
|
||||||
else:
|
|
||||||
out += '0'
|
|
||||||
i += 1
|
|
||||||
return out
|
|
||||||
|
|
||||||
# do the actual search
|
# do the actual search
|
||||||
def search(target,data):
|
def search(target,data):
|
||||||
|
|
Loading…
Reference in a new issue