solana-hmac-sha256

Crates.iosolana-hmac-sha256
lib.rssolana-hmac-sha256
version0.2.0
sourcesrc
created_at2024-09-12 11:39:39.205637
updated_at2024-09-14 04:45:16.395668
descriptionAn efficient implementation of HMAC-SHA256 for SVM
homepage
repository
max_upload_size
id1372687
size6,506
Dean 利迪恩 (deanmlittle)

documentation

README

solana-hmac-sha256

A simple implementation of HMAC Sha256 using solana-nostd-sha256

Usage

To emulate the digest functionality of the hmac crate, use HmacSha256:

let mut h = HmacSha256::new(b"test");
h.update(b"test");
h.finalize(); // -> outputs [u8;32]

This is most useful for chaining hashes together.

To quickly produce a single hmac-sha256 hash, use the hmac_sha256 function:

let h = hmac_sha256(b"test", b"test"); // -> [u8;32]
Commit count: 0

cargo fmt