Documentation ¶
Index ¶
- func BcryptCheck(password, hashed string) bool
- func BcryptEncode(password string) (encoded string, err error)
- func DecryptMessageWithAES(encrypted string, secret string) (decrypted string, err error)
- func EncryptMessageWithAES(message string, secret string) (encrypted string, err error)
- func HashEntryMD5[T any](entry T) string
- func HashMD5(message string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BcryptEncode ¶
BcryptEncode 使用 bcrypt 加密算法加密密码
- password: 明文密码
- encoded: 加密后的密码
- err: 错误信息
没有出错重试机制,出错直接返回 err
func DecryptMessageWithAES ¶
DecryptMessageWithAES 使用 AES 加密算法解密消息
- encrypted: 加密后的消息
- secret: 密钥,长度必须是 16、24 或 32 位
- decrypted: 解密后的消息
- err: 错误信息
没有出错重试机制,出错直接返回 err
func EncryptMessageWithAES ¶
EncryptMessageWithAES 使用 AES 加密算法加密消息
- message: 明文消息
- secret: 密钥,长度必须是 16、24 或 32 位
- encrypted: 加密后的消息
- err: 错误信息
没有出错重试机制,出错直接返回 err
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.