Documentation
¶
Index ¶
- Variables
- func Base64(dst, src []byte)
- func Base64String(b []byte) string
- func Base64StringDecode(s string) ([]byte, error)
- func Base64StringDecodeToString(s string) (string, error)
- func Base64URL(dst, src []byte)
- func Base64URLString(b []byte) string
- func Base64URLStringBulkDecode(s ...string) ([][]byte, error)
- func Base64URLStringDecode(s string) ([]byte, error)
- func Base64URLStringDecodeToString(s string) (string, error)
- func CheckPasswordHash(password, hash string) bool
- func CheckPasswordHashWithArgon2(password, encodedHash string) (match bool, err error)
- func HashPassword(password string) (string, error)
- func HashPasswordWithArgon2(password string, params *Argon2HashingParam) (string, error)
- func HashString(plaintext string, alg crypto.Hash) []byte
- func HashStringToBase64(plaintext string, alg crypto.Hash) string
- func HashStringToBase64URL(plaintext string, alg crypto.Hash) string
- func HashStringToHex(plaintext string, alg crypto.Hash) string
- func JSONMapper(src interface{}, dest interface{}) error
- func RandomBytes(n uint64) ([]byte, error)
- type Argon2HashingParam
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultArgon2HashingParams = &Argon2HashingParam{
memory: 64 * 1024,
iterations: 3,
parallelism: 4,
saltLength: 16,
keyLength: 32,
}
View Source
var ErrIncompatibleVersion = errors.New("incompatible version of argon2")
View Source
var ErrInvalidHash = errors.New("the encoded hash is not in the correct format")
Functions ¶
func Base64String ¶
func Base64StringDecode ¶
func Base64URLString ¶
func Base64URLStringBulkDecode ¶ added in v0.0.2
func Base64URLStringDecode ¶
func CheckPasswordHash ¶
func HashPassword ¶
func HashPasswordWithArgon2 ¶
func HashPasswordWithArgon2(password string, params *Argon2HashingParam) (string, error)
func JSONMapper ¶
func JSONMapper(src interface{}, dest interface{}) error
func RandomBytes ¶
Types ¶
type Argon2HashingParam ¶
type Argon2HashingParam struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.