Standard library
HMAC
HMAC-SHA256.
Introduction
HMAC-SHA256. Import std/crypto/hmac to bind the module as hmac. Call free functions as hmac.name(...). Struct methods use a receiver value.
/ std/crypto/hmac
This page is the package reference for std/crypto/hmac. Private helpers used only by co-located tests are not listed.
Functions
Free functions on hmac. Each function has a short description, an example, then parameters and return shape.
sha256
Computes HMAC-SHA256 of data under key. Call form: hmac.sha256(key, data).
/ std/crypto/hmac
$ mac = hmac.sha256(b"key", b"msg")
Parameters: key: key bytes. data: bytes or string input. Returns: 32-byte MAC.