Discover Packages
github.com/niktheblak/passwordhash
pkg
hasher
package
Version:
v0.0.0-...-555b434
Opens a new window with list of versions in this module.
Published: May 10, 2024
License: AGPL-3.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
View Source
var (
ErrHashTooShort = errors .New ("hashed password is too short")
ErrInvalidHashPrefix = errors .New ("invalid hash prefix")
ErrInvalidPassword = errors .New ("password does not match hash")
ErrInvalidSalt = errors .New ("invalid salt length")
)
type Hasher interface {
Hash(data []byte ) (hash []byte , err error )
Compare(passwordHash, password []byte ) error
}
type SaltedHasher interface {
HashWithSalt(password, salt []byte ) ([]byte , error )
CompareSalted(passwordHash, password, salt []byte ) error
}
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.