From b0c0febbab0d9c37daebcf642cc220aaa7d222c1 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Thu, 13 Jul 2017 19:43:58 -0700 Subject: [PATCH] Remove to_dec, we don't use it --- blocksfree/legacy.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/blocksfree/legacy.py b/blocksfree/legacy.py index 649f18a..d91e98c 100755 --- a/blocksfree/legacy.py +++ b/blocksfree/legacy.py @@ -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]