Documentation ¶
Index ¶
- Constants
- type HashComparer
- func NewArgon2IDHasher(saltSize int, iterations int, keylen int, memory uint32, parallelism uint8) HashComparer
- func NewBcryptHashComparer(cost int) HashComparer
- func NewHasher(authOpts map[string]string, backend string) HashComparer
- func NewPBKDF2Hasher(saltSize int, iterations int, algorithm string, saltEncoding string, ...) HashComparer
Constants ¶
View Source
const ( // algorithms SHA512 = "sha512" SHA256 = "sha256" SHA256Size = 32 SHA512Size = 64 // encodings UTF8 = "utf-8" Base64 = "base64" // hashers Pbkdf2Opt = "pbkdf2" Argon2IDOpt = "argon2id" BcryptOpt = "bcrypt" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashComparer ¶
type HashComparer interface { Hash(password string) (string, error) Compare(password, passwordHash string) bool }
func NewArgon2IDHasher ¶
func NewBcryptHashComparer ¶
func NewBcryptHashComparer(cost int) HashComparer
func NewHasher ¶
func NewHasher(authOpts map[string]string, backend string) HashComparer
NewHasher returns a hasher depending on the given options.
func NewPBKDF2Hasher ¶
Click to show internal directories.
Click to hide internal directories.