Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHashProvider ¶
func NewHashProvider(app *foundation.Application) *hashProvider
NewHashProvider Bootstrap bootstraps the hashing services.
Types ¶
type BcryptHasher ¶
type BcryptHasher struct { }
func (*BcryptHasher) Check ¶
func (b *BcryptHasher) Check(value, hashedValue string) bool
Check returns true if the value matches the hashed value.
func (*BcryptHasher) Make ¶
func (b *BcryptHasher) Make(value string) (string, error)
Make returns the hashed value.
func (*BcryptHasher) MakeWithCost ¶
func (b *BcryptHasher) MakeWithCost(value string, cost int) (string, error)
MakeWithCost returns the hashed value with the given cost.
func (*BcryptHasher) MustMake ¶
func (b *BcryptHasher) MustMake(value string) string
MustMake returns the hashed value.
type HashManager ¶
type HashManager struct {
// contains filtered or unexported fields
}
func NewHashManager ¶
func NewHashManager(config map[string]interface{}) *HashManager
NewHashManager creates a new hashing manager instance. config example:
config := map[string]interface{}{ "driver": "bcrypt", }
func (*HashManager) Driver ¶
func (m *HashManager) Driver(driver ...string) Hasher
Driver gets the hasher instance by driver name.
type Hasher ¶
type Md5Hasher ¶ added in v0.1.1
type Md5Hasher struct { }
func NewMd5Hasher ¶ added in v0.1.1
func NewMd5Hasher() *Md5Hasher
NewMd5Hasher creates a new md5 hasher instance.
Click to show internal directories.
Click to hide internal directories.