Documentation ¶
Index ¶
Constants ¶
View Source
const ( HASHED_PASSWORD_FORMAT = "$argon2id$v=%d$m=%d,t=%d,p=%d$%s$%s" ArgonSaltLength = 16 ArgonKeyLength = 32 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CryptService ¶
type CryptService interface { // Hash is a function to hash data using sha256 Hash(data string) string // Base64Encode is a function to encode data using base64 Base64Encode(data string) string // Base64Decode is a function to decode data using base64 Base64Decode(data string) (string, error) // Decrypt is a function to decrypt data using aes256-gcm Decrypt(key string, data string) (string, error) // Encrypt is a function to encrypt data using aes256-gcm Encrypt(key string, data string) (string, error) // PasswordHash is a function to hash password using argon2id PasswordHash(password string) (string, error) // PasswordVerify is a function to verify password using argon2id PasswordVerify(password string, hash string) (bool, error) // MD5 is a function to hash data using md5 MD5(data string) (string, error) }
func NewCrypt ¶
func NewCrypt() CryptService
Click to show internal directories.
Click to hide internal directories.