Merge pull request #1246 from prusnak/drop-binascii

use bytes.fromhex/hex builtins instead of binascii.hexlify/unhexlify
This commit is contained in:
calle
2023-01-03 10:52:28 +01:00
committed by GitHub
10 changed files with 22 additions and 35 deletions
+1 -2
View File
@@ -2,7 +2,6 @@ import base64
import hashlib
import hmac
import urllib
from binascii import unhexlify
from http import HTTPStatus
from typing import Dict
@@ -19,7 +18,7 @@ def generate_bleskomat_lnurl_signature(
payload: str, api_key_secret: str, api_key_encoding: str = "hex"
):
if api_key_encoding == "hex":
key = unhexlify(api_key_secret)
key = bytes.fromhex(api_key_secret)
elif api_key_encoding == "base64":
key = base64.b64decode(api_key_secret)
else: