From d5d7a454887a5fb1bef4541e8d668db87b0bc1df Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Tue, 26 Mar 2024 17:38:20 +0100 Subject: [PATCH] correct TypeError: Strings must be encoded before hashing in node.py --- fail2ban-p2p/node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fail2ban-p2p/node.py b/fail2ban-p2p/node.py index e415023..e9de9b2 100644 --- a/fail2ban-p2p/node.py +++ b/fail2ban-p2p/node.py @@ -199,7 +199,7 @@ class Node: logger.debug("our own pubkey is: %s" % pubkey) - self.uid = str(hashlib.sha224(pubkey).hexdigest()) + self.uid = str(hashlib.sha224(pubkey.encode(encoding = 'UTF-8', errors = 'strict')).hexdigest()) logger.debug("that makes our own uid: %s", self.uid) self.addresses = c.addresses self.port = c.port