Versions in this module Expand all Collapse all v1 v1.0.0 Aug 30, 2023 Changes in this version + func ComparePassword(hashed, password string) error + func HashPassword(password string, cost int) (string, error) + func OptimalCost(target time.Duration) int + func ShouldUpdateCost(hashed string, cost int) (bool, error) + type Crypto interface + Decrypt func(encrypted string) ([]byte, error) + Encrypt func(plain []byte) (string, error) + func AES(key []byte) Crypto + type KeyDerivator interface + Derive func(password string, salt []byte) []byte + type KeySize int + const Key256 + func (size KeySize) NewDerivator(iterations int) *keyDerivator + func (size KeySize) OptimalIterations(target time.Duration) int + type PasswordHasher interface + ComparePassword func(hashed, password string) error + Cost func() int + HashPassword func(password string) (string, error) + ShouldUpdateCost func(hashed string) (bool, error) + func NewPasswordHasher(target time.Duration) PasswordHasher