Documentation
¶
Overview ¶
Package enigma is a Go utility library for cryptographic operations, including JWT creation, password hashing, and API key generation.
Index ¶
Constants ¶
View Source
const ( // HashingCost is the cost for cryptographic hashing. HashingCost = 14 // APIKeyPrefixLength is the length of API key prefixes. APIKeyPrefixLength = 8 // APIKeySecretNBytes is the number of bytes in API key secrets. APIKeySecretNBytes = 32 // IDPrefixJWT is the prefix for JWT IDs. IDPrefixJWT = "jwt" )
Variables ¶
This section is empty.
Functions ¶
func NewEnigma ¶
func NewEnigma( timeProvider TimeProvider, secretKey string, ) *enigma
NewEnigma returns a new enigma.
Types ¶
type JWTType ¶
type JWTType string
JWTType is a string representing type of JWT. Allowed strings are "access", "refresh", and "activation".
type TimeProvider ¶
TimeProvider represents a component that provides the current timestamp.
Click to show internal directories.
Click to hide internal directories.