crypto

package
Version: v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

CheckPasswordHash if the hash (usually stored in database) matches users entered password

func ComputeHmac

func ComputeHmac(hashFunc func() hash.Hash, message string, secret string) string

func GenerateSecretKey

func GenerateSecretKey(numBytes int) (string, error)

GenerateSecretKey generated n-byte secret key and returns in hex format string

func HashPassword

func HashPassword(password string) (string, error)

HashPassword - stronger encryption for storing passwords

func ValidateHmacSignature

func ValidateHmacSignature(hashFunc func() hash.Hash, payload string, secret string, hexDigest string) bool

ValidateHMacSignature validates signature from a sent payload

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL