blockstream-satellite-api/server/utils.py
Blockstream Satellite 9d421771e7 Port the satellite API to python
- Preserve the SQLite database and use SQLAlchemy to wrap db
  interactions.
- Use Alembic for database migrations.
- Organize all the python modules on the new server/ directory.
- Use pytest for unit tests and organize test modules at server/tests/.
2021-07-20 12:28:08 -03:00

9 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()