Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultMemory uint32 = 64 * 1024 DefaultIterations uint32 = 1 DefaultThreads uint8 = 4 )
Variables ¶
This section is empty.
Functions ¶
func WithIterations ¶ added in v1.2.0
WithIterations configure the iterations for Encoder, default value is 1
func WithKeyLen ¶
WithKeyLen configure the key length for Encoder, default value is 32
func WithMemory ¶
WithMemory configure the memory for Encoder, default value is 64 * 1024
func WithSalt ¶
WithSalt configure the salt value for Encoder, default automatically generate random strings
func WithSaltLen ¶
WithSaltLen configure the salt length for Encoder, default value is 16
func WithThreads ¶
WithThreads configure the Threads for Encoder, default value is 4
Types ¶
type Encoder ¶
type Encoder struct { // The amount of memory used by the algorithm (in kibibytes). Memory uint32 // The number of iterations over the memory. Iterations uint32 // The number of threads (or lanes) used by the algorithm. // Recommended value is between 1 and runtime.NumCPU(). Threads uint8 // Length of the random salt. 16 bytes is recommended for password hashing. SaltLen uint32 // Length of the generated key. 16 bytes or more is recommended. KeyLen uint32 // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.