correct TypeError: Strings must be encoded before hashing in node.py

This commit is contained in:
Mario Fetka 2024-03-26 18:49:56 +01:00
parent d5d7a45488
commit bb9f6c3a8b

View File

@ -232,7 +232,7 @@ class Node:
error = True error = True
if pubkey: if pubkey:
logger.debug("read friend's public key: %s" % pubkey ) logger.debug("read friend's public key: %s" % pubkey )
uid = str(hashlib.sha224(pubkey).hexdigest()) uid = str(hashlib.sha224(pubkey.encode(encoding = 'UTF-8', errors = 'strict')).hexdigest())
try: try:
address = re.search("address\s*=\s*(.*)", friendinfo).group(1) address = re.search("address\s*=\s*(.*)", friendinfo).group(1)
except AttributeError: except AttributeError: