argon2id

package
v0.0.0-...-739c5f9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Version = argon2.Version

Variables

View Source
var (
	ErrInvalidFormat       = errors.New("argon2id: invalid format")
	ErrIncompatibleVariant = errors.New("argon2id: incompatible variant")
	ErrIncompatibleVersion = errors.New("argon2id: incompatible version")
)
View Source
var DefaultParams = &Params{
	Memory:      64 * 1024,
	Iterations:  1,
	Parallelism: uint8(runtime.NumCPU()),
	SaltLength:  16,
	KeyLength:   32,
}

Functions

func Encode

func Encode(params *Params, salt, key []byte) string

func Key

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

func RandomSalt

func RandomSalt(n uint32) ([]byte, error)

Types

type Params

type Params struct {
	Memory      uint32
	Iterations  uint32
	Parallelism uint8
	SaltLength  uint32
	KeyLength   uint32
}

func Decode

func Decode(hash string) (params *Params, salt, key []byte, err error)

type Service

type Service interface {
	Hash([]byte) (string, error)
	Compare([]byte, string) (bool, bool, error)
}

func NewService

func NewService(params *Params) Service

Jump to

Keyboard shortcuts

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