every libs/*.py and hooks/*.py now starts with a one-line module docstring; every bin/* script starts with a `# purpose:` header. discovery-by-`ls`-and-read instead of by index. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12 lines
303 B
Python
12 lines
303 B
Python
"""hmac: base64-encoded HMAC-SHA512 helper."""
|
|
|
|
import hmac, hashlib, base64
|
|
|
|
def hmac_sha512(secret, iv):
|
|
return base64.b64encode(
|
|
hmac.new(
|
|
bytes(iv , 'latin-1'),
|
|
msg=bytes(secret , 'latin-1'),
|
|
digestmod=hashlib.sha512
|
|
).digest()
|
|
).decode()
|