Documentation ¶
Index ¶
- Constants
- Variables
- func IsDeprecated(hasher string) bool
- func MarkDeprecated(hasher string, hashers ...string)
- func UnmarkDeprecated(hasher string, hashers ...string)
- type Argon2idHasher
- type BcryptHasher
- type Hasher
- type HasherManager
- func (m *HasherManager) Check(value string, hashedValue string) (bool, error)
- func (m *HasherManager) IdentifyHasher(hashedValue string) (string, bool)
- func (m *HasherManager) Make(value string) (string, error)
- func (m *HasherManager) NeedsRehash(hashedValue string) bool
- func (m *HasherManager) RegisterHasher(hasher string, h Hasher, prefix string)
- type Md5Hasher
Constants ¶
View Source
const Md5Prefix = "$md5$"
Variables ¶
View Source
var DefaultArgon2idHasher = &Argon2idHasher{Params: argon2id.DefaultParams}
View Source
var DefaultBcryptHasher = &BcryptHasher{Cost: bcrypt.DefaultCost}
View Source
var ErrUnknownHasher = errors.New("unknown hasher")
Functions ¶
func IsDeprecated ¶ added in v0.1.7
func MarkDeprecated ¶ added in v0.1.7
func UnmarkDeprecated ¶ added in v0.1.7
Types ¶
type Argon2idHasher ¶
func (*Argon2idHasher) Check ¶
func (h *Argon2idHasher) Check(value string, hashedValue string) (bool, error)
func (*Argon2idHasher) NeedsRehash ¶
func (h *Argon2idHasher) NeedsRehash(hashedValue string) bool
type BcryptHasher ¶
type BcryptHasher struct {
Cost int
}
func (*BcryptHasher) Check ¶
func (h *BcryptHasher) Check(value string, hashedValue string) (bool, error)
func (*BcryptHasher) NeedsRehash ¶
func (h *BcryptHasher) NeedsRehash(hashedValue string) bool
type HasherManager ¶
type HasherManager struct { DefaultHasher string Hashers map[string]Hasher MapHashPrefix map[string]string }
func NewHasherManager ¶
func NewHasherManager() *HasherManager
func (*HasherManager) Check ¶
func (m *HasherManager) Check(value string, hashedValue string) (bool, error)
func (*HasherManager) IdentifyHasher ¶
func (m *HasherManager) IdentifyHasher(hashedValue string) (string, bool)
func (*HasherManager) NeedsRehash ¶
func (m *HasherManager) NeedsRehash(hashedValue string) bool
func (*HasherManager) RegisterHasher ¶ added in v0.1.7
func (m *HasherManager) RegisterHasher(hasher string, h Hasher, prefix string)
Click to show internal directories.
Click to hide internal directories.