mirror of
https://github.com/Blockstream/satellite-api.git
synced 2025-02-23 14:00:26 +01:00
10 lines
244 B
Python
10 lines
244 B
Python
|
import hmac
|
||
|
import hashlib
|
||
|
|
||
|
|
||
|
def hmac_sha256_digest(key, data):
|
||
|
assert (isinstance(key, str))
|
||
|
assert (isinstance(data, str))
|
||
|
return hmac.new(key.encode(), msg=data.encode(),
|
||
|
digestmod=hashlib.sha256).hexdigest()
|