Documentation ¶
Index ¶
Constants ¶
const RememberTokenBytes = 32
RememberTokenBytes specifies the length of the remember token in bytes. According to the Open Web App. Sec. Project (OWASP), this should be at least 128 bits == 16 bytes. We are using 256 bits == 32 bytes. See: https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html#session-id-length for details.
Variables ¶
This section is empty.
Functions ¶
func Bytes ¶
Bytes will help us generate n random bytes, or will return an error if there was one. This uses the crypto/rand package so it is safe to use with things like remember tokens.
func NBytes ¶
NBytes returns the number of bytes used in any string generated by the String or RememberToken functions in this package.
func RememberToken ¶
RememberToken is a helper function designed to generate remember tokens of a predetermined byte size.
Types ¶
This section is empty.