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

index 6562f77617f1f9f950777b67b00e3f66af6f9961..442d2810380c8a2f9019150dbed41e70f4b5e83e 100755 (executable)
@@ -39,11 +39,7 @@ def search(target,data):
 
 # convert integer to binary string
 def binstring(number):
-       out= ''
-       while number > 0:
-               out += chr(0x30 + (number & 0x01))
-               number= number >> 1
-       return stringreverse(out)
+       return bin(number)[2:] if number > 0 else ''
 
 # reverse string order
 def stringreverse(data):
Impressum, Datenschutz