Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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.
