1
0

util: kill bh2u

no longer useful, and the name is so confusing...
This commit is contained in:
SomberNight
2023-02-17 11:35:03 +00:00
parent 1ce37c8bb1
commit 373db76ac9
52 changed files with 151 additions and 168 deletions

View File

@@ -30,7 +30,7 @@ import string
from typing import Sequence, Dict
from types import MappingProxyType
from .util import resource_path, bfh, bh2u, randrange
from .util import resource_path, bfh, randrange
from .crypto import hmac_oneshot
from . import version
from .logging import Logger
@@ -224,7 +224,7 @@ class Mnemonic(Logger):
def is_new_seed(x: str, prefix=version.SEED_PREFIX) -> bool:
x = normalize_text(x)
s = bh2u(hmac_oneshot(b"Seed version", x.encode('utf8'), hashlib.sha512))
s = hmac_oneshot(b"Seed version", x.encode('utf8'), hashlib.sha512).hex()
return s.startswith(prefix)