hashers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashVersion

type HashVersion int
const (
	SHA3Version HashVersion = iota + 1
)

type Sha3Hasher

type Sha3Hasher struct{}

func NewHasher

func NewHasher() Sha3Hasher

func (Sha3Hasher) CreateHash

func (s Sha3Hasher) CreateHash(secretKey string) (string, error)

CreateHash hashes secretKey using a random salt and SHA3/SHA512.

func (Sha3Hasher) VerifyHash

func (s Sha3Hasher) VerifyHash(hash, secretKey string) error

VerifyHash compares a key with the hash, and will produce an error if the hash does not match or if the hash is not a valid SHA3 hash.

Jump to

Keyboard shortcuts

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