hmac

package
v0.0.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package hmac provides a simple way to verify a message

Original Author: github.com/alexellis

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMAC

func CheckMAC(message, messageMAC, key []byte, sha func() hash.Hash) bool

CheckMAC verifies hash checksum

func Sign

func Sign(message, key []byte, sha func() hash.Hash) []byte

Sign a message with the key and return bytes. Note: for human readable output see encoding/hex and encode string functions.

func Validate

func Validate(bytesIn []byte, encodedHash string, secretKey string) error

Validate validate an encodedHash taken from GitHub via X-Hub-Signature HTTP Header. Note: if using another source, just add a 5 letter prefix such as "sha1="

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL