Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultBcryptCost = 12
DefaultBcryptCost is the cost used for hashing OTPs.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate produces a cryptographically random 6-digit code and its bcrypt hash. The caller must send `plain` to the user and persist `hash` in the database. The plain-text code must never be stored.
func GenerateWithCost ¶
GenerateWithCost produces a cryptographically random 6-digit code and its bcrypt hash with a custom cost.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.