hmac256

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig() *types.Config

func NewHMAC256Crypto

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

NewHMAC256Crypto creates a new HMAC256 crypto instance

Types

type ConfigValidator

type ConfigValidator struct {
	SaltLength int
}

func (ConfigValidator) Validate

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

type HMAC256

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

HMAC256 implements the HMAC-SHA256 hashing algorithm

func (*HMAC256) Hash

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

Hash implements the hash method

func (*HMAC256) HashWithSalt

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

HashWithSalt implements the hash with salt method

func (*HMAC256) Verify

func (c *HMAC256) Verify(hashed, 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