security

package
v0.0.0-...-3ad5073 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Memory      = 64 * 1024 // 64 MB
	Iterations  = 3
	Parallelism = 2
	SaltLength  = 16 // 16 bytes
	KeyLength   = 32 // 32 bytes
)

Parameters for the Argon2ID algorithm

Variables

This section is empty.

Functions

func GenerateRandomBytes

func GenerateRandomBytes(length uint32) ([]byte, error)

func GenerateRandomBytesEncoded

func GenerateRandomBytesEncoded(length uint32) (string, error)

Types

type Argon2Hasher

type Argon2Hasher struct{}

func (*Argon2Hasher) Hash

func (h *Argon2Hasher) Hash(plain string) (string, error)

Hash implements Hasher.

func (*Argon2Hasher) Verify

func (h *Argon2Hasher) Verify(plain string, hashed string) (bool, error)

Verify implements Hasher.

type Hasher

type Hasher interface {
	Hash(plain string) (string, error)
	Verify(plain, hashed string) (bool, error)
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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