forked from rDrama/rDrama
master
parent
500c4090a4
commit
b3e70c0012
|
@ -1,16 +0,0 @@
|
|||
def hex2bin(hexstr):
|
||||
value = int(hexstr, 16)
|
||||
bindigits = []
|
||||
|
||||
# Seed digit: 2**0
|
||||
digit = (value % 2)
|
||||
value //= 2
|
||||
bindigits.append(digit)
|
||||
|
||||
while value > 0:
|
||||
# Next power of 2**n
|
||||
digit = (value % 2)
|
||||
value //= 2
|
||||
bindigits.append(digit)
|
||||
|
||||
return ''.join([str(d) for d in bindigits])
|
Loading…
Reference in New Issue