crypto

package
v0.3.9-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(data string) []byte

func Base64Encode

func Base64Encode(data []byte) string

func BcryptCompare

func BcryptCompare(hashedPassword, password string) error

func BcryptHash

func BcryptHash(password string) (string, error)

func BcryptHashMust

func BcryptHashMust(password string) string

func DecryptAES

func DecryptAES(aesKey, cipherText []byte) ([]byte, error)

DecryptAES 对 AES 加密字符串解密

func DecryptAESMust

func DecryptAESMust(aesKey, cipherText []byte) []byte

func DecryptEntField

func DecryptEntField() ent.Interceptor

DecryptEntField 在查询时解密字段

func EncryptAES

func EncryptAES(aesKey, plainText []byte) ([]byte, error)

EncryptAES 对字符串进行 AES 加密

func EncryptAESMust

func EncryptAESMust(aesKey, plainText []byte) []byte

func EncryptedMixin

func EncryptedMixin() ent.Hook

EncryptedMixin 自动加密/解密带 `_encrypted` 后缀的字段

func SHA256

func SHA256(data []byte) string

func Username2UserID

func Username2UserID(username string) int64

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL