Versions in this module Expand all Collapse all v0 v0.999.0 Aug 8, 2024 v0.2.25 Aug 8, 2024 Changes in this version + const DigestSHA1 + const DigestSHA224 + const DigestSHA256 + const DigestSHA384 + const DigestSHA512 + const ErrFmtDigestDecode + const ErrFmtDigestMatch + const ErrFmtHasherHash + const ErrFmtHasherValidation + const ErrFmtInvalidIntParameter + const KeyLengthDefault + const SaltLengthDefault + var ErrEncodedHashInvalidFormat = errors.New("provided encoded hash has an invalid format") + var ErrEncodedHashInvalidIdentifier = errors.New("provided encoded hash has an invalid identifier") + var ErrEncodedHashInvalidOption = errors.New("provided encoded hash has an invalid option") + var ErrEncodedHashInvalidOptionKey = errors.New("provided encoded hash has an invalid option key") + var ErrEncodedHashInvalidOptionValue = errors.New("provided encoded hash has an invalid option value") + var ErrEncodedHashInvalidVersion = errors.New("provided encoded hash has an invalid version") + var ErrEncodedHashKeyEncoding = errors.New("provided encoded hash has a key value that can't be decoded") + var ErrEncodedHashSaltEncoding = errors.New("provided encoded hash has a salt value that can't be decoded") + var ErrKeyDerivation = errors.New("failed to derive the key with the provided parameters") + var ErrParameterInvalid = errors.New("parameter is invalid") + var ErrPasswordInvalid = errors.New("password is invalid") + var ErrSaltEncoding = errors.New("provided salt has a value that can't be decoded") + var ErrSaltInvalid = errors.New("salt is invalid") + var ErrSaltReadRandomBytes = errors.New("could not read random bytes for salt") + type DecodeFunc func(encodedDigest string) (digest Digest, err error) + type Decoder interface + Decode func(encodedDigest string) (digest Digest, err error) + type DecoderRegister interface + RegisterDecodeFunc func(prefix string, decoder DecodeFunc) (err error) + RegisterDecodePrefix func(prefix, identifier string) (err error) + type Digest interface + Encode func() (hash string) + type Hash interface + Hash func(password string) (hashed Digest, err error) + HashWithSalt func(password string, salt []byte) (hashed Digest, err error) + MustHash func(password string) (hashed Digest) + Validate func() (err error) + type HashFunc func() hash.Hash + type Matcher interface + Match func(password string) (match bool) + MatchAdvanced func(password string) (match bool, err error) + MatchBytes func(passwordBytes []byte) (match bool) + MatchBytesAdvanced func(passwordBytes []byte) (match bool, err error)