OxL Reference

method hmac.sha256

HMAC-SHA-256 of input under key (32 bytes).

Example:

oxl✓ checked in CI
use std.crypto { hmac }
use std.ser { bytesOf }

fn main() io {
  print("{hmac.sha256(bytesOf(&"key"), bytesOf(&"message")).len()}")
}
Output
32
pub(api) static fn sha256(key: bytes, input: bytes) -> bytes

Since. 1.0.0-beta

Parameters

NameType
keybytes
inputbytes

Returns

bytes

Effects

none declared (pure unless the body says otherwise)

Defined in: std/crypto/crypto.oxl:218

See also