Documentation
¶
Overview ¶
package salt provides methods for generating string values that can be used as (hashing) salts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidSalt ¶
IsValidSalt returns a boolean value indicating whether 's' can be used a salt.
Types ¶
type Salt ¶
type Salt struct {
// contains filtered or unexported fields
}
Salt is a struct containing methods and values that can be used as (hashing) salts.
func NewRandomSalt ¶
func NewRandomSalt(opts *SaltOptions) (*Salt, error)
NewRandomSalt return a new `Salt` instance for a random string configured by 'opts'.
func NewSaltFromString ¶
NewSaltFromString returns a new `Salt` instance derived from 's'.
type SaltOptions ¶
type SaltOptions struct { // The length of the final salting string. Length int // A boolean flag indicating that the salt should only contain ASCII characters. ASCII bool }
SaltOptions is a struct containing configuration options for the `NewRandomSalt` method.
func DefaultSaltOptions ¶
func DefaultSaltOptions() *SaltOptions
DefaultOptions returns an `SaltOptions` instance with no limits or restrictions save a minimum length of 32 bytes.
Click to show internal directories.
Click to hide internal directories.