Help us shape the future of Go! Take the 2026 Go Developer Survey

secret

package
v2.3.198 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 5 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, error)
	HashMatchesString(hash, password string) bool
}

type Password

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

func New

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

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, error)

Jump to

Keyboard shortcuts

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