hmac

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig() *types.Config

func NewDefaultHMACCrypto

func NewDefaultHMACCrypto(config *types.Config) (interfaces.Cryptographic, error)

NewDefaultHMACCrypto creates a new HMAC crypto instance

func NewHMAC256Crypto

func NewHMAC256Crypto(config *types.Config) (interfaces.Cryptographic, error)

func NewHMAC512Crypto

func NewHMAC512Crypto(config *types.Config) (interfaces.Cryptographic, error)

func NewHMACCrypto

func NewHMACCrypto(hashType types.Type, config *types.Config) (interfaces.Cryptographic, error)

NewHMACCrypto creates a new HMAC crypto instance

Types

type ConfigValidator

type ConfigValidator struct {
	SaltLength int
}

func (ConfigValidator) Validate

func (v ConfigValidator) Validate(config *types.Config) error

type HMAC

type HMAC struct {
	// contains filtered or unexported fields
}

HMAC implements the HMAC hashing algorithm

func (*HMAC) Hash

func (c *HMAC) Hash(password string) (string, error)

Hash implements the hash method

func (*HMAC) HashWithSalt

func (c *HMAC) HashWithSalt(password, salt string) (string, error)

HashWithSalt implements the hash with salt method

func (*HMAC) Type

func (c *HMAC) Type() string

func (*HMAC) Verify

func (c *HMAC) Verify(parts *types.HashParts, password string) error

Verify implements the verify method

Jump to

Keyboard shortcuts

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