hash

package
v0.0.0-...-9efae6e Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argon2IdHasher

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

func NewArgon2IdHasher

func NewArgon2IdHasher() *Argon2IdHasher

func (*Argon2IdHasher) Hash

func (h *Argon2IdHasher) Hash(data string) (string, error)

Hash generates a secure Argon2id hash of the given password.

func (*Argon2IdHasher) Verify

func (h *Argon2IdHasher) Verify(data, storedHash string) bool

Verify verifies if the given data matches the stored hash.

type Hasher

type Hasher interface {
	Hash(data string) (string, error)
	Verify(data, storedHash string) bool
}

type SimpleTokenHasher

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

func NewSimpleTokenHasher

func NewSimpleTokenHasher(secretKey string) *SimpleTokenHasher

func (*SimpleTokenHasher) Hash

func (h *SimpleTokenHasher) Hash(data string) (string, error)

func (*SimpleTokenHasher) Verify

func (h *SimpleTokenHasher) Verify(data, originalHash string) bool

Jump to

Keyboard shortcuts

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