diff --git a/lbry/wallet/server/hash.py b/lbry/wallet/server/hash.py index a1a5d8068..2c0201952 100644 --- a/lbry/wallet/server/hash.py +++ b/lbry/wallet/server/hash.py @@ -67,17 +67,17 @@ def hash160(x): return ripemd160(sha256(x)) -def hash_to_hex_str(x): +def hash_to_hex_str(x: bytes) -> str: """Convert a big-endian binary hash to displayed hex string. Display form of a binary hash is reversed and converted to hex. """ - return bytes(reversed(x)).hex() + return x[::-1].hex() -def hex_str_to_hash(x): +def hex_str_to_hash(x: str) -> bytes: """Convert a displayed hex string to a binary hash.""" - return bytes(reversed(hex_to_bytes(x))) + return hex_to_bytes(x)[::-1] class Base58Error(Exception):