mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-11-10 17:49:32 +08:00
simplified findbits.binstring()
This commit is contained in:
parent
9f975d42e8
commit
df1e29bb40
1 changed files with 1 additions and 5 deletions
|
@ -39,11 +39,7 @@ def search(target,data):
|
||||||
|
|
||||||
# convert integer to binary string
|
# convert integer to binary string
|
||||||
def binstring(number):
|
def binstring(number):
|
||||||
out= ''
|
return bin(number)[2:] if number > 0 else ''
|
||||||
while number > 0:
|
|
||||||
out += chr(0x30 + (number & 0x01))
|
|
||||||
number= number >> 1
|
|
||||||
return stringreverse(out)
|
|
||||||
|
|
||||||
# reverse string order
|
# reverse string order
|
||||||
def stringreverse(data):
|
def stringreverse(data):
|
||||||
|
|
Loading…
Reference in a new issue