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 AlgIdentifierSHA256 + const AlgIdentifierSHA512 + const AlgName + const EncodingFmt + const EncodingFmtRoundsOmitted + const IterationsDefaultOmitted + const IterationsDefaultSHA256 + const IterationsDefaultSHA512 + const IterationsMax + const IterationsMin + const SaltCharSet + const SaltLengthMax + const SaltLengthMin + 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 RegisterDecoderSHA512(r algorithm.DecoderRegister) (err error) + type Digest struct + func (d *Digest) Encode() (hash 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() (hasher *Hasher, err error) + func NewSHA512() (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 WithIterations(iterations int) Opt + func WithRounds(rounds int) Opt + func WithSHA256() Opt + func WithSHA512() Opt + func WithSaltLength(bytes int) Opt + func WithVariant(variant Variant) Opt + func WithVariantName(identifier string) Opt + type Variant int + const VariantNone + const VariantSHA256 + const VariantSHA512 + func NewVariant(identifier string) Variant + func (v Variant) DefaultIterations() int + func (v Variant) HashFunc() algorithm.HashFunc + func (v Variant) Name() (s string) + func (v Variant) Prefix() (prefix string) + func (v Variant) String() (identifier string)