Skip to content

Instantly share code, notes, and snippets.

@jedisct1
Created June 30, 2023 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jedisct1/c598ae296b59bdbe29be93241aa6faab to your computer and use it in GitHub Desktop.
Save jedisct1/c598ae296b59bdbe29be93241aa6faab to your computer and use it in GitHub Desktop.
const std = @import("std");
const HmacSha256 = std.crypto.auth.hmac.sha2.HmacSha256;
pub fn main() !void {
var out: [HmacSha256.mac_length]u8 = undefined;
HmacSha256.create(&out, "The quick brown fox jumps over the lazy dog", "key");
std.debug.print("{s}\n", .{std.fmt.bytesToHex(&out, .lower)});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment