utils

package
v0.0.0-...-06cf8dc Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDeCrypt

func AesDeCrypt(content []byte) ([]byte, error)

AesDeCrypt @Description: AES解密

func AesEnCrypt

func AesEnCrypt(plainBytes []byte) []byte

AesEnCrypt @Description: AES加密

func FileHash

func FileHash(filePath string, h hash.Hash) (string, error)

FileHash @Description: 计算文件哈希

func FilterSymbol

func FilterSymbol(src string) string

FilterSymbol @Description: 过滤特殊字符

func GeneratePrivateIp

func GeneratePrivateIp(input string) string

GeneratePrivateIp @Description: 通过字符串生成固定内网IP

func InArrayInt64

func InArrayInt64(src int64, target []int64) bool

InArrayInt64 @Description: 判断int64是否在数组内

func InArrayString

func InArrayString(src string, target []string) bool

InArrayString @Description: 判断字符串是否在数组内

func InArrayUint64

func InArrayUint64(src uint64, target []uint64) bool

InArrayUint64 @Description: 判断uint64是否在数组内

func IsEmpty

func IsEmpty(val any) bool

IsEmpty @Description: 判断any类型数据是否为空

func IsPrivateIp

func IsPrivateIp(ipString string) bool

IsPrivateIp @Description: 判断是否为私有IP

func Md5EnCrypt

func Md5EnCrypt(data string) string

Md5EnCrypt @Description: MD5加密

func PKCS7Padding

func PKCS7Padding(data []byte, blockSize int) []byte

PKCS7Padding @Description: 添加PKCS7填充

func Random

func Random(l int, t int) string

Random @Description: 随机生成字符串

func RandomImei

func RandomImei(prefix string) string

RandomImei @Description: 随机生成IMEI

func RandomMeid

func RandomMeid(prefix string) string

RandomMeid @Description: 随机生成MEID

func TernaryIf

func TernaryIf[T any](condition bool, trueValue, falseValue T) T

TernaryIf @Description: 三元表达式

func TernaryIfFunc

func TernaryIfFunc[T any](condition bool, trueValue, falseValue func() T) T

TernaryIfFunc @Description: 三元表达式-返回方法

Types

This section is empty.

Jump to

Keyboard shortcuts

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