Documentation ¶
Index ¶
Constants ¶
View Source
const (
HashSize = 32
)
Variables ¶
View Source
var ( CSRFKey = []byte("0655A28CAAEB0448132026D863771C5D") ErrGeneratedBadToken = errors.New("Generated a token with an invalid length.") )
Functions ¶
func NewAuthToken ¶
func NewAuthToken() []byte
NewAuthToken returns a hex-encoded byte slice with a length of 64. The token is generated by reading from the OS' PRNG source, usually /dev/urandom on Unix-like systems and the CryptGenRandom API on Windows.
func NewCSRFToken ¶
NewCSRFToken returns a byte slice with a new base-64 encoded CSRF token, only valid for a user's session.
func NewJobID ¶
func NewJobID() string
Create fast random strings for job IDs. Made up to 29 million unique strings before I quit testing.
func NewSessionID ¶
func NewSessionID() string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.