Documentation ¶
Index ¶
- Variables
- func CompareHashAndPassword(encoded []byte, password []byte) error
- func GenerateFromPassword(password []byte) ([]byte, error)
- func GenerateFromPasswordWithParams(password []byte, params IDParams) ([]byte, error)
- func GenerateFromPasswordWithParamsAndSalt(password []byte, params IDParams, salt []byte) ([]byte, error)
- func GenerateRandomBytes(size uint32) ([]byte, error)
- type IDParams
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMismatchedHashAndPassword is returned when password and hash do not match ErrMismatchedHashAndPassword = errors.New("argon2: encoded is not the hash of the given password") // ErrIncompatibleVersion is returned when hash versions are not compatible ErrIncompatibleVersion = errors.New("argon2: version is not compatible") // ErrInvalidHash is returned when the encoded hash has an invalid format ErrInvalidHash = errors.New("argon2: encoded hash has invalid format") )
Functions ¶
func CompareHashAndPassword ¶ added in v0.1.0
CompareHashAndPassword compares an argon2id hashed and encoded password with its possible plaintext equivalent. Returns nil on success, or an error on failure.
func GenerateFromPassword ¶
GenerateFromPassword generates a new argon2id encoded hash from the specified password
func GenerateFromPasswordWithParams ¶
GenerateFromPasswordWithParams generates a new argon2id encoded hash from the specified password using the parameters specified
func GenerateFromPasswordWithParamsAndSalt ¶ added in v0.1.0
func GenerateFromPasswordWithParamsAndSalt(password []byte, params IDParams, salt []byte) ([]byte, error)
GenerateFromPasswordWithParamsAndSalt generates a new argon2id encoded hash from the specified password and salt using the parameters specified
func GenerateRandomBytes ¶
GenerateRandomBytes generates random bytes of the specified size
Types ¶
Click to show internal directories.
Click to hide internal directories.