Documentation ¶
Index ¶
Constants ¶
View Source
const (
InfoAuth = "auth"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Hash ¶
type Hash struct { Alg string TimeCost uint32 MemoryCost uint32 Threads uint8 Info string Hash []byte Salt []byte }
Hash represents a password hash derived from `Argon2id` and HKDF
func NewFromHash ¶
NewFromHash created a new hash from an existing password hash
type Hasher ¶
type Hasher struct { TimeCost uint32 MemoryCost uint32 Threads uint8 Info string Salt []byte // contains filtered or unexported fields }
func NewHasher ¶
NewHasher returns a new Hasher with the given password and options. The hasher can be used to either generate a new hash (for auth) or derive a secret key.
type Option ¶
type Option func(*Hasher)
func WithDefaultOpts ¶
func WithDefaultOpts() Option
func WithParameters ¶
WithParameters allow to change the default parameters for the hash.
Click to show internal directories.
Click to hide internal directories.