auth

package
v0.0.0-...-0ebd481 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const VariableArgon2RequiredMemory uint64 = 64 * 1024

VariableArgon2RequiredMemory defines the recommended memory in bytes to use to generate an Argon2id hashed password

View Source
const VariableMemoryTolerance float64 = 0.5

VariableMemoryTolerance defines the maximum amount of the available heap to use for hashing passwords

Variables

This section is empty.

Functions

func GenerateArgon2idHash

func GenerateArgon2idHash(plaintext string, salt []byte) []byte

GenerateArgon2idHash returns the hash of the plaintext string using Argon2

func GenerateRandomBytes

func GenerateRandomBytes(requiredLength uint64) ([]byte, error)

GenerateRandomBytes returns a slice of randomly generated bytes

func HashPlaintext

func HashPlaintext(plaintext string) (string, string, error)

HashPlaintext hashes and salts the given plaintext string and returns the result as a base64-encoded hash and salt

func ValidateHash

func ValidateHash(plaintext string, encodedHash string, encodedSalt string) error

ValidateHash validates a provided plaintext string with the provided base64-encoded hash and salt

Types

This section is empty.

Jump to

Keyboard shortcuts

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