cleanup, docs

This commit is contained in:
root
2026-06-16 23:02:45 +00:00
parent ea08d5f28b
commit b8b56cf3dd
160 changed files with 1076 additions and 511 deletions
+13 -4
View File
@@ -1,10 +1,19 @@
# hmac_sha256_hex
:sig
String hmac_sha256_hex(String key, String data)
:params
key : secret key
data : message to authenticate
return value : the HMAC-SHA256 as a 64-character lowercase hex string
Returns the lowercase hexadecimal HMAC-SHA-256 digest.
:content
Computes an HMAC-SHA256 message authentication code and returns it as hex. Use it to sign tokens, cookies, and webhook payloads, then verify with `crypto_equal()` to avoid timing leaks.
:example
print(hmac_sha256_hex("key", "data"), "\n");
print(hmac_sha256_hex("key", "The quick brown fox jumps over the lazy dog"), "\n");
:see
>noise
>sys
hmac_sha256
sha256_hex
crypto_equal