go-hmac

module
v0.0.0-...-5caf956 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: GPL-3.0

README

Simple HMAC Library written in Go

This is a simple HMAC library that implements the HMAC algorithm described in RFC2104. Currently supports the generation of HMAC digests using MD5, SHA-1, SHA-256 and SHA-512 hashing primitives.

Usage

Simply import the library and use the preferred hashing function:

  package main

  import (
    "fmt"
    "github.com/mcaimi/go-hmac/rfc2104"
    )

  const (
    KEY = "my-secret-key"
    MSG = "plaintext"
    )

  func main() {
    var digest []byte
    digest = rfc2104.Hmac([]byte(KEY), []byte(MSG), "sha1");

    fmt.Printf("%x\n", digest);
  }

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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