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 AlgIdentifier + const AlgIdentifierUnversioned + const AlgIdentifierVariantSHA256 + const AlgIdentifierVerA + const AlgIdentifierVerX + const AlgIdentifierVerY + const AlgName + const EncodingFmt + const EncodingFmtSHA256 + const IterationsDefault + const IterationsMax + const IterationsMin + const PasswordInputSizeMax + const VariantNameSHA256 + const VariantNameStandard + func Decode(encodedDigest string) (digest algorithm.Digest, err error) + func DecodeVariant(v Variant) func(encodedDigest string) (digest algorithm.Digest, err error) + func RegisterDecoder(r algorithm.DecoderRegister) (err error) + func RegisterDecoderSHA256(r algorithm.DecoderRegister) (err error) + func RegisterDecoderStandard(r algorithm.DecoderRegister) (err error) + type Digest struct + func (d *Digest) Encode() string + func (d *Digest) Iterations() int + func (d *Digest) Key() []byte + func (d *Digest) Match(password string) (match bool) + func (d *Digest) MatchAdvanced(password string) (match bool, err error) + func (d *Digest) MatchBytes(passwordBytes []byte) (match bool) + func (d *Digest) MatchBytesAdvanced(passwordBytes []byte) (match bool, err error) + func (d *Digest) Salt() []byte + func (d *Digest) String() string + func (d *Digest) Variant() Variant + type Hasher struct + func New(opts ...Opt) (hasher *Hasher, err error) + func NewSHA256(opts ...Opt) (hasher *Hasher, err error) + func (h *Hasher) Hash(password string) (digest algorithm.Digest, err error) + func (h *Hasher) HashWithSalt(password string, salt []byte) (digest algorithm.Digest, err error) + func (h *Hasher) MustHash(password string) (digest algorithm.Digest) + func (h *Hasher) Validate() (err error) + func (h *Hasher) WithOptions(opts ...Opt) (err error) + type Opt func(h *Hasher) (err error) + func WithCost(iterations int) Opt + func WithIterations(iterations int) Opt + func WithVariant(variant Variant) Opt + func WithVariantName(identifier string) Opt + type Variant int + const VariantNone + const VariantSHA256 + const VariantStandard + func NewVariant(identifier string) (variant Variant) + func (v Variant) Encode(cost int, version string, salt, key []byte) (f string) + func (v Variant) EncodeInput(src, salt []byte) (dst []byte) + func (v Variant) PasswordMaxLength() int + func (v Variant) Prefix() (prefix string) + func (v Variant) String() (name string)