]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
simplified findbits.invert()
authordn337t@gmail.com <dn337t@gmail.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Wed, 20 Jun 2012 20:25:35 +0000 (20:25 +0000)
committerdn337t@gmail.com <dn337t@gmail.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Wed, 20 Jun 2012 20:25:35 +0000 (20:25 +0000)
tools/findbits.py

index 03e0c4e08345f4818c1884a589dd761e5574495e..6562f77617f1f9f950777b67b00e3f66af6f9961 100755 (executable)
@@ -26,15 +26,7 @@ import string
 
 # invert binary string
 def invert(data):
-       i=  0
-       out= ''
-       while(i < len(data)):
-               if data[i] == '0':
-                       out += '1'
-               else:
-                       out += '0'
-               i += 1
-       return out
+       return ''.join('0' if c == '1' else '1' for c in data)
 
 # do the actual search
 def search(target,data):
Impressum, Datenschutz