Remove to_dec, we don't use it

This commit is contained in:
T. Joseph Carter 2017-07-13 19:43:58 -07:00
parent 666ab4d578
commit b0c0febbab
1 changed files with 0 additions and 13 deletions

View File

@ -799,19 +799,6 @@ def to_hex(val):
else:
raise Exception("to_hex() requires bytes, int/long, or [bin-ustr]")
def to_dec(val):
"""convert bytes, hex-ustr or [bin-ustr] to decimal int/long"""
if isinstance(val, list): # [bin-ustr]
return int(val[0], 2)
elif isinstance(val, bytes): # bytes
return int(to_hex(val), 16)
elif isinstance(val, str): # hex-ustr
return int(val, 16)
elif isnumber(val): # int/long
return val
else:
raise Exception("to_dec() requires bytes, hex-ustr or [bin-ustr]")
def to_bytes(val):
"""converts hex-ustr, int/long, or [bin-ustr] to bytes"""
if isinstance(val, list): # [bin-ustr]