funga/crypto_dev_signer/common.py

12 lines
210 B
Python
Raw Normal View History

2020-08-04 23:41:31 +02:00
def strip_hex_prefix(hx):
if hx[:2] == '0x':
return hx[2:]
return hx
def add_hex_prefix(hx):
if len(hx) < 2:
return hx
if hx[:2] != '0x':
return '0x' + hx
return hx