Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Argon2Crypto ¶ added in v1.1.0
type Argon2Crypto struct {
// contains filtered or unexported fields
}
func NewArgon2Crypto ¶ added in v1.1.0
func NewArgon2Crypto() Argon2Crypto
Create Argon2Crypto with recommended options
func NewArgon2CryptoWithOptions ¶ added in v1.1.0
func NewArgon2CryptoWithOptions(saltLen int, time, memory uint32, threads uint8, keyLen uint32) Argon2Crypto
Create Argon2Crypto with given salt length, time, memory, threads and key length.
func (Argon2Crypto) Check ¶ added in v1.1.0
func (a Argon2Crypto) Check(input, hashed string) (bool, bool, error)
func (Argon2Crypto) ID ¶ added in v1.1.0
func (a Argon2Crypto) ID() string
type Crypto ¶
type Crypto struct {
// contains filtered or unexported fields
}
type HashFunction ¶
type HashFunction int
const ( SHA1 HashFunction = 0 //SHA224 HashFunction = 1 SHA256 HashFunction = 2 //SHA384 HashFunction = 3 SHA512 HashFunction = 4 )
func ParseHashFunction ¶
func ParseHashFunction(in string) (HashFunction, error)
func (HashFunction) Hash ¶
func (h HashFunction) Hash() func() hash.Hash
func (HashFunction) String ¶
func (h HashFunction) String() string
type PBKDF2Crypto ¶
type PBKDF2Crypto struct {
// contains filtered or unexported fields
}
func NewPBKDF2CryptoWithOptions ¶
func NewPBKDF2CryptoWithOptions(iter, keyLen, saltLen int, hashFns []HashFunction) PBKDF2Crypto
Create PBKDF2C with given number of iterations, key length, salt length and accepted hash functions.
First hash function is the preferred one which will be used for new passwords, all other ones will signal the need for an upgrade.
func (PBKDF2Crypto) ID ¶
func (a PBKDF2Crypto) ID() string
type SHA1Crypto ¶
type SHA1Crypto struct {
// contains filtered or unexported fields
}
func NewSHA1CryptoWithOptions ¶
func NewSHA1CryptoWithOptions(saltLen int) SHA1Crypto
func (SHA1Crypto) ID ¶
func (a SHA1Crypto) ID() string
type SHA256Crypto ¶
type SHA256Crypto struct {
// contains filtered or unexported fields
}
func NewSHA256CryptoWithOptions ¶
func NewSHA256CryptoWithOptions(saltLen int) SHA256Crypto
func (SHA256Crypto) ID ¶
func (a SHA256Crypto) ID() string
type ScryptCrypto ¶
type ScryptCrypto struct {
// contains filtered or unexported fields
}
func NewScryptCrypto ¶
func NewScryptCrypto() ScryptCrypto
Create ScryptCrypto with recommended options
func NewScryptCryptoWithOptions ¶
func NewScryptCryptoWithOptions(saltLen, cpuMemCost, r, p, keyLen int) ScryptCrypto
Create ScryptCrypto with given salt length, CPU/mem cost, r, p and key length.
func (ScryptCrypto) ID ¶
func (a ScryptCrypto) ID() string
Click to show internal directories.
Click to hide internal directories.