Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultTokenLength = 32 // 256 bits
)
Variables ¶
View Source
var ( ErrTooManyInputAlphabet = errors.New("must only provide 1 set of alphabet") ErrAlphabetTooLong = errors.New("alphabet must contain no more than 255 characters") ErrAlphabetTooShort = errors.New("alphabet must contain at least 8 characters") ErrAlphabetInvalidUTF8 = errors.New("alphabet must contain valid UTF-8") ErrAlphabetNotASCII = errors.New("alphabet must contain only ASCII characters") )
View Source
var (
ErrTooManyArgs = errors.New("too many arguments. expected only 1")
)
Functions ¶
func VerifyToken ¶
Types ¶
type Argon2 ¶
type Argon2 struct {
Memory uint32 // Memory cost in KiB
Iterations uint32 // Number of iterations (time cost)
Parallelism uint8 // Number of parallel threads
SaltLength uint32 // Length of random salt. Ignored during Verify()
KeyLength uint32 // Length of generated key
}
func NewArgon2 ¶
func NewArgon2() *Argon2
Create a new Argon2 instance
@ref https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html
type NanoIDGenerator ¶
type NanoIDGenerator struct {
// contains filtered or unexported fields
}
func NewNanoID ¶
func NewNanoID(a ...string) (*NanoIDGenerator, error)
type PasswordHandler ¶
Click to show internal directories.
Click to hide internal directories.