main.go
TEXT FILE271 B · Public source code for developers, search crawlers and AI agents
1package main
2
3import (
4 "crypto/hmac"
5 "crypto/sha512"
6 "fmt"
7)
8
9func mac(key, msg []byte) []byte { h := hmac.New(sha512.New, key); h.Write(msg); return h.Sum(nil) }
10func main() { fmt.Printf("%x\n", mac([]byte("demo key"), []byte("demo message"))) }Read-only source · Select a line number to link directly · Raw download above
