argon2

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 8 Imported by: 0

README

Argon2

Coming Soon™

Documentation

Overview

Package argon2 provides an easy-to-use wrapper around the argon2 crypto library.

Index

Constants

View Source
const (
	Version = argon2.Version

	Memory      uint32 = 65536
	Iterations  uint32 = 3
	Parallelism uint8  = 2
	SaltLength  uint32 = 16
	KeyLength   uint32 = 32
)

Variables

View Source
var (
	// ErrIncompatibleVersion is an incompatible version error.
	ErrIncompatibleVersion = errors.New("argon2: incompatible version")

	// ErrInvalidHash is an invalid hash error.
	ErrInvalidHash = errors.New("argon2: invalid hash")

	// ErrFailedVerify is a failed verification error.
	ErrFailedVerify = errors.New("argon2: failed verify")
)

Functions

func Hash

func Hash(input []byte) ([]byte, error)

Hash hashes the input using the argon2id algorithm.

func HashAndVerify

func HashAndVerify(input []byte) ([]byte, error)

HashAndVerify hashes the input using the argon2id algorithm, then verifies it.

func Verify

func Verify(input, hash []byte) error

Verify verifies the input against a hash.

Types

type Password

type Password []byte

Password .

func (Password) MarshalJSON

func (Password) MarshalJSON() ([]byte, error)

MarshalJSON satisfies the json.Marshaler interface.

func (*Password) Set

func (p *Password) Set(password []byte) error

Set .

func (Password) UnmarshalJSON

func (Password) UnmarshalJSON([]byte) error

UnmarshalJSON satisfies the json.Unmarshaler interface.

func (Password) Verify

func (p Password) Verify(input []byte) (bool, error)

Verify .

Jump to

Keyboard shortcuts

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