Documentation
¶
Overview ¶
Package hash implements the functions, types, and interfaces for the module.
Package hash implements the functions, types, and interfaces for the module.
Package hash implements the functions, types, and interfaces for the module.
Package hash provides the hash functions ¶
Package hash implements the functions, types, and interfaces for the module.
Index ¶
- Constants
- func Generate(password string) (string, error)
- func GenerateWithSalt(password, salt string) (string, error)
- func RegisterAlgorithm(t types.Type, creator AlgorithmCreator, defaultConfig AlgorithmConfig)
- func UseCrypto(t types.Type, opts ...types.Option) error
- func Verify(hashed, password string) error
- type AlgorithmConfig
- type AlgorithmCreator
- type Crypto
Constants ¶
View Source
const ( // ENV environment variable name ENV = "ORIGADMIN_HASH_TYPE" // ErrPasswordNotMatch error when password not match ErrPasswordNotMatch = errors.String("password not match") )
Variables ¶
This section is empty.
Functions ¶
func GenerateWithSalt ¶ added in v0.0.20
func RegisterAlgorithm ¶ added in v0.0.20
func RegisterAlgorithm(t types.Type, creator AlgorithmCreator, defaultConfig AlgorithmConfig)
RegisterAlgorithm registers a new hash algorithm
Types ¶
type AlgorithmConfig ¶ added in v0.0.21
type AlgorithmCreator ¶ added in v0.0.21
type AlgorithmCreator func(*types.Config) (interfaces.Cryptographic, error)
Click to show internal directories.
Click to hide internal directories.