password

package
v0.0.0-...-a6bf376 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPolicy = &Policy{
		Upper:     1,
		Lower:     1,
		Number:    1,
		Special:   1,
		MinLength: 12,
		MaxLength: 64,
	}
	DefaultParams = &Params{
		Memory:     64 * 1024,
		Iterations: 1,
		Threads:    uint8(runtime.NumCPU()),
		KeyLength:  32,
	}
)

Functions

func Hash

func Hash(password []byte, salt []byte, params *Params) []byte

func IsValid

func IsValid(password []byte, policy *Policy) bool

Types

type Params

type Params struct {
	Memory     uint32
	Iterations uint32
	Threads    uint8
	KeyLength  uint32
}

type Policy

type Policy struct {
	Upper     int
	Lower     int
	Number    int
	Special   int
	MinLength int
	MaxLength int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳