Versions in this module Expand all Collapse all v0 v0.0.1 Sep 24, 2021 Changes in this version + const MagicPrefix + const RoundsDefault + const RoundsMax + const RoundsMin + const SaltLenMax + const SaltLenMin + var ErrKeyMismatch = errors.New("hashed value is not the hash of the given password") + var ErrSaltFormat = errors.New("invalid salt format") + var ErrSaltPrefix = errors.New("invalid magic prefix") + var ErrSaltRounds = errors.New("invalid rounds") + func Base64_24Bit(src []byte) []byte + type Crypter interface + Cost func(hashedKey string) (int, error) + Generate func(key, salt []byte) (string, error) + SetSalt func(salt Salt) + Verify func(hashedKey string, key []byte) error + func New() Crypter + type SHA512 struct + Salt Salt + func (c *SHA512) Cost(hashedKey string) (int, error) + func (c *SHA512) Generate(key, salt []byte) (string, error) + func (c *SHA512) SetSalt(salt Salt) + func (c *SHA512) Verify(hashedKey string, key []byte) error + type Salt struct + MagicPrefix []byte + RoundsDefault int + RoundsMax int + RoundsMin int + SaltLenMax int + SaltLenMin int + func GetSalt() Salt + func (s *Salt) GenerateWRounds(length, rounds int) ([]byte, error)