utils

package
v0.0.0-...-18a26fb Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ciphertext string, key []byte) (string, error)

Decrypt 解密函数

func Encrypt

func Encrypt(plaintext string, key []byte) (string, error)

Encrypt 加密函数

func EncryptToByte

func EncryptToByte(plaintext string, key []byte) ([]byte, error)

func GenerateRandomKey

func GenerateRandomKey(timestamp int64) []byte

func GetIDButNotNumber

func GetIDButNotNumber(baseName string) string

GetIDButNotNumber 生成Cube ID前缀, 2024JIAY 需要自行补充数字

func IsEmailValid

func IsEmailValid(email string) bool

func IsPhoneNumberValid

func IsPhoneNumberValid(phoneNumber string) bool

func MathRandomConfig

func MathRandomConfig() *base64Captcha.DriverMath

MathRandomConfig 生成图形化算术验证码配置

func RandomString

func RandomString(length int) string

func RemoveSpacesAndTranslate

func RemoveSpacesAndTranslate(input string) string

RemoveSpacesAndTranslate 将输入字符串中的空格移除,并将中文字符翻译成拼音后截取前四位英文

func TIF

func TIF[T any](t bool, a1 T, a2 T) T

func TranslateEn

func TranslateEn(input string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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