Documentation
¶
Overview ¶
Package crypt contains a number of cryptographic functions
Index ¶
Constants ¶
View Source
const ( Argon2Algo = "Argon2id" // Default tuned to process at least 20 API requests/sec on 2CPU Argon2Memory = 64 * 1024 // 64MB Argon2Iterations = 1 Argon2Threads = 8 // Optimal to quickly execute one request, with not much overhead Argon2Saltlen = 8 Argon2Hashlen = 32 RandStringCharsetB58 = "abcdefghijkmnopqrstuvwxyz" + "ABCDEFGHJKLMNPQRSTUVWXYZ123456789" // Base58 RandStringCharsetAZ = "abcdefghijklmnopqrstuvwxyz" // Only a-z )
Default parameters for the Argon2 hashing and some charsets usable for representing the data
Variables ¶
This section is empty.
Functions ¶
func InitTLSPairCa ¶ added in v0.7.5
InitTLSPairCa creates a pair of asymmetric keys and CA if needed
func RandString ¶
RandString generates random string with base58 characters
func RandStringCharset ¶ added in v0.7.0
RandStringCharset creates random string of specified size
Types ¶
type Hash ¶
type Hash struct {
Algo string
Prop properties `gorm:"embedded;embeddedPrefix:prop_"`
Salt []byte
Hash []byte
}
Hash contains everything needed for storing and reproducing password hash
func NewHash ¶ added in v0.7.5
NewHash generates a salted hash for the input string with default parameters
Click to show internal directories.
Click to hide internal directories.