argon2

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package argon2 contains the Argon2id hasher implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argon2idHasher

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

Argon2idHasher wraps parameterized Argon2id hashing operations.

func Default

func Default() *Argon2idHasher

Default returns an Argon2idHasher configured with library defaults.

func (*Argon2idHasher) Hash

func (a *Argon2idHasher) Hash(password []byte) (string, error)

Hash derives an Argon2id key and returns the PHC string.

func (*Argon2idHasher) ID

func (a *Argon2idHasher) ID() string

ID reports the PHC algorithm identifier.

func (*Argon2idHasher) NeedsRehash

func (a *Argon2idHasher) NeedsRehash(encoded string) (bool, error)

NeedsRehash reports whether the encoded parameters diverge from the current configuration.

func (*Argon2idHasher) Verify

func (a *Argon2idHasher) Verify(password []byte, encoded string) (bool, error)

Verify recomputes the Argon2id hash and compares it in constant time.

Jump to

Keyboard shortcuts

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