Versions in this module Expand all Collapse all v1 v1.1.0 Aug 30, 2023 Changes in this version + type Argon2Crypto struct + func NewArgon2Crypto() Argon2Crypto + func NewArgon2CryptoWithOptions(saltLen int, time, memory uint32, threads uint8, keyLen uint32) Argon2Crypto + func (a Argon2Crypto) Check(input, hashed string) (bool, bool, error) + func (a Argon2Crypto) Hash(input string) (string, error) + func (a Argon2Crypto) ID() string v1.0.0 Jun 23, 2020 Changes in this version + type Algorithm interface + Check func(input, hashed string) (bool, bool, error) + Hash func(input string) (string, error) + ID func() string + type Crypto struct + func New(algorithms ...Algorithm) *Crypto + func (c *Crypto) Check(input, hashed string) (valid bool, mustUpgrade bool, err error) + func (c *Crypto) Hash(input string) (string, error) + type HashFunction int + const SHA1 + const SHA256 + const SHA512 + func ParseHashFunction(in string) (HashFunction, error) + func (h HashFunction) Hash() func() hash.Hash + func (h HashFunction) String() string + type NullCrypto struct + func (n NullCrypto) Check(input, hashed string) (bool, bool, error) + func (n NullCrypto) Hash(input string) (string, error) + func (n NullCrypto) ID() string + type PBKDF2Crypto struct + func NewPBKDF2Crypto() PBKDF2Crypto + func NewPBKDF2CryptoWithOptions(iter, keyLen, saltLen int, hashFns []HashFunction) PBKDF2Crypto + func (a PBKDF2Crypto) Check(input, hashed string) (bool, bool, error) + func (a PBKDF2Crypto) Hash(input string) (string, error) + func (a PBKDF2Crypto) ID() string + type SHA1Crypto struct + func NewSHA1Crypto() SHA1Crypto + func NewSHA1CryptoWithOptions(saltLen int) SHA1Crypto + func (a SHA1Crypto) Check(input, hashed string) (bool, bool, error) + func (a SHA1Crypto) Hash(input string) (string, error) + func (a SHA1Crypto) ID() string + type SHA256Crypto struct + func NewSHA256Crypto() SHA256Crypto + func NewSHA256CryptoWithOptions(saltLen int) SHA256Crypto + func (a SHA256Crypto) Check(input, hashed string) (bool, bool, error) + func (a SHA256Crypto) Hash(input string) (string, error) + func (a SHA256Crypto) ID() string + type ScryptCrypto struct + func NewScryptCrypto() ScryptCrypto + func NewScryptCryptoWithOptions(saltLen, cpuMemCost, r, p, keyLen int) ScryptCrypto + func (a ScryptCrypto) Check(input, hashed string) (bool, bool, error) + func (a ScryptCrypto) Hash(input string) (string, error) + func (a ScryptCrypto) ID() string