passwords

package
v0.0.0-...-39e06ca Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultArgon2Iterations = 3

DefaultArgon2Iterations value

View Source
const DefaultArgon2KeyLength = 32

DefaultArgon2KeyLength value

View Source
const DefaultArgon2Memory = 64 * 1024

DefaultArgon2Memory value

View Source
const DefaultArgon2Parallelism = 2

DefaultArgon2Parallelism value

View Source
const DefaultArgon2SaltLength = 16

DefaultArgon2SaltLength value

Variables

This section is empty.

Functions

func ComparePasswordAndHash

func ComparePasswordAndHash(password, encodedHash string) (match bool, err error)

ComparePasswordAndHash verifies a password is same as password used to generate the given hash

Types

type Argon2Config

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

Argon2Config values for configuring the Argon2 hashing algorithm

type ContextIn

type ContextIn struct {
	Argon2Config Argon2Config
}

ContextIn describes dependecies needed by this package

type ContextOut

type ContextOut struct {
	PasswordHasher PasswordHasher
}

ContextOut describes dependencies exported by this package

func Bootstrap

func Bootstrap(in *ContextIn) *ContextOut

Bootstrap initializes this module with ContextIn and exports resulting ContextOut

type PasswordHasher

type PasswordHasher interface {
	GeneratePasswordHash(password string) (encodedHash string, err error)
}

PasswordHasher generates hashes for cleartext passwords

Jump to

Keyboard shortcuts

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