simplified findbits.binstring()

This commit is contained in:
dn337t@gmail.com 2012-06-20 20:31:49 +00:00
parent 9f975d42e8
commit df1e29bb40

View file

@ -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):