utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 秘钥
	PUBLICKEY = "XWCtbPwDn4e6glqc"
	// 偏移量
	IV = "0000000000000000"
)

定义常量

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(crypted []byte) ([]byte, error)

@title AesDecrypt @description AES解密

func AesEncrypt

func AesEncrypt(origData []byte) ([]byte, error)

@title AesEncrypt @description AES加密

func Bytes2Int

func Bytes2Int(bys []byte) int

@title Bytes2Int @description 字节转换成整数 @param bys []byte 字节内容 @return int 整形值

func BytesCombine

func BytesCombine(pBytes ...[]byte) []byte

@title BytesCombine @description 字节合并 @return []byte 结果

func FileExist added in v1.1.6

func FileExist(path string) bool

@title FileExist @description 验证文件或文件夹是否存在 @param path string 文件路径 @return bool 是否存在

func GetCurrentTimestamp

func GetCurrentTimestamp() int64

@title GetCurrentTimestamp @description 获取当前时间时间戳 @return int64 时间戳

func GetFileContentType

func GetFileContentType(out *os.File) (string, error)

@title GetFileContentType @description 获取文件扩展名 @return string 结果 @return error 错误

func Int2Bytes

func Int2Bytes(n int) []byte

@title Int2Bytes @description 整数转换成字节 @param n int 整数值 @return byte[] 字节数组

func IsLittleEndian

func IsLittleEndian() bool

@title IsLittleEndian @description 大小端判断 @return bool 结果

func PKCS5Padding

func PKCS5Padding(plaintext []byte, blockSize int) []byte

@title PKCS5Padding @description 填充明文

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

@title PKCS5UnPadding @description 去除填充数据

func PKCS7Padding

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

@title PKCS7Padding @description 填充明文

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

@title PKCS7UnPadding @description 去除填充数据

Types

This section is empty.

Jump to

Keyboard shortcuts

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