argon

package
v0.1.86 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package argon is api's slow hash, argon2id, for what has too few values for a fast one: a PIN, and the fingerprint of a request that carries a PIN or an age. A hash is written as the PHC string format writes it, $argon2id$v=19$m=19456,t=2,p=1$<salt>$<hash>, so that it carries its own parameters, and raising them later needs no migration: a hash made before is still checked by the parameters it names.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(secret []byte) string

Hash is the PHC string of argon2id of secret, with a salt of its own. crypto/rand never fails on the platforms api runs on.

func Is

func Is(s string) bool

Is says whether s is written as a hash of this package: what tells a slow fingerprint from a fast one.

func Matches

func Matches(secret []byte, phc string) bool

Matches says whether secret is what phc is the hash of, by the parameters phc names. A string that is no argon2id hash of this version matches nothing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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