Documentation ¶
Index ¶
- Constants
- Variables
- func Argon2iSettings(m, t, p, k int, salts ...string) (string, error)
- func Argon2idSettings(m, t, p, k int, salts ...string) (string, error)
- func BCryptSettings(cost int, salts ...string) (string, error)
- func Crypt(password, settings string) (string, error)
- func Encode24BitBase64(src []byte) []byte
- func RegisterAlgorithm(prefix string, algorithm Algorithm)
- func Settings(settings string) string
- type Algorithm
- type Parameter
Constants ¶
const Argon2iPrefix = "$argon2i$"
Argon2iPrefix defines the settings prefix for argon2i hashes.
const Argon2idPrefix = "$argon2id$"
Argon2idPrefix defines the settings prefix for argon2id hashes.
const BCryptPrefix = "$2a$"
BCryptPrefix defines the settings prefix for bcrypt hashes.
const MD5Prefix = "$1$"
MD5Prefix defines the settings prefix for md5 hashes.
const SHA256Prefix = "$5$"
SHA256Prefix defines the settings prefix for sha256 hashes.
const SHA512Prefix = "$6$"
SHA512Prefix defines the settings prefix for sha512 hashes.
Variables ¶
var Base64Encoding = base64.StdEncoding.WithPadding(base64.NoPadding)
Base64Encoding implements the crypt-specific base63 encoding.
Functions ¶
func Argon2iSettings ¶
Argon2iSettings returns argon2i settings with the provided parameter.
func Argon2idSettings ¶ added in v0.2.0
Argon2idSettings returns argon2id settings with the provided parameter.
func BCryptSettings ¶
BCryptSettings returns bcrypt settings with the provided parameter.
func Encode24BitBase64 ¶
Encode24BitBase64 implements a special version of base64 that is used with md5, sha256 and sha512.
func RegisterAlgorithm ¶
RegisterAlgorithm registers an algorithm under the provided prefix.