secret

package
v2.2.6 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

func GenerateRandomString

func GenerateRandomString(n int) (string, error)

Types

type Hasher

type Hasher interface {
	HashString(str string) string
	HashMatchesString(hash, password string) bool
}

type Password

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

func New

func New(salt string) (*Password, error)

func (*Password) HashMatches

func (p *Password) HashMatches(h1, h2 string) bool

func (*Password) HashMatchesString added in v2.0.4

func (p *Password) HashMatchesString(hash, password string) bool

func (*Password) HashString

func (p *Password) HashString(str string) string

Jump to

Keyboard shortcuts

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