Documentation ¶
Index ¶
- Variables
- func CheckPassword(password string, encodedHash string) (match bool, err error)
- func Child() bool
- func Debug() bool
- func DebugExec(function func())
- func FromJson(source []byte) interface{}
- func FromJsonToObject(source []byte, destination interface{}) error
- func FromJsonToObjectMultiple(source [][]byte, destination interface{}) error
- func GenerateRandomBytes(n uint32) ([]byte, error)
- func GenerateRandomSession() []byte
- func HashBytesSHA512(inputBytes []byte) string
- func HashMD5(text string) string
- func HashPassword(password string) (encodedHash string, err error)
- func HashSHA512(input string) string
- func InterfaceToObject(input interface{}, output interface{}) error
- func NonChildExec(function func())
- func RandomAlphanumeric(length int) (string, error)
- func StripeEnabledExec(function func())
- func ToJson(source interface{}) []byte
- type Argon2Params
- type Time
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidHash = errors.New("the encoded hash is not in the correct format") ErrIncompatibleVersion = errors.New("incompatible version of argon2") )
Functions ¶
func CheckPassword ¶
CheckPassword checks that the provided password matches the hashed password.
func FromJsonToObject ¶
func GenerateRandomBytes ¶
generateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomSession ¶
func GenerateRandomSession() []byte
Generate a random UUID for the session
func HashPassword ¶
HashPassword returns a Argon2id hash of a password with the given parameters.
func InterfaceToObject ¶
func InterfaceToObject(input interface{}, output interface{}) error
func NonChildExec ¶
func NonChildExec(function func())
func RandomAlphanumeric ¶
Generate a random alphanumeric string
func StripeEnabledExec ¶
func StripeEnabledExec(function func())
Types ¶
type Argon2Params ¶
type Argon2Params struct { Memory uint32 Iterations uint32 Parallelism uint8 SaltLength uint32 KeyLength uint32 }
func DecodeHash ¶
func DecodeHash(encodedHash string) (p *Argon2Params, salt, hash []byte, err error)
decodeHash extracts the parameters, salt and derived key from an encoded argon2 password hash.
type Time ¶
type Time int64
func FromTimestamp ¶
func GetTimestamp ¶
func GetTimestamp() Time
func (Time) FormattedDate ¶
func (Time) FormattedTime ¶
Click to show internal directories.
Click to hide internal directories.