Versions in this module Expand all Collapse all v0 v0.3.0 Aug 26, 2026 Changes in this version + const DefaultBcryptCost + var ErrInvalidKeySize = errors.New("authit/crypto: key must be 32 bytes") + func CheckPassword(password, hash string) bool + func DecryptSecret(key []byte, ciphertext []byte) (string, error) + func EncryptSecret(key []byte, plaintext string) ([]byte, error) + func GenerateBackupCodes(n int) ([]string, error) + func GenerateOpaqueToken() (raw string, hash string, err error) + func GenerateTOTPSecret(issuer, accountName string) (*otp.Key, error) + func GenerateUserCode() (string, error) + func HashBackupCode(code string) string + func HashPassword(password string) (string, error) + func HashPasswordWithCost(password string, cost int) (string, error) + func HashToken(raw string) string + func NewID() (string, error) + func ValidateTOTPCode(secret, code string) bool v0.2.0 Aug 25, 2026