files

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PwdKey = []byte("ABCDABCDABCDABCD") //key每个项目需要重新设置,不要泄漏

Functions

func AesDecrypt

func AesDecrypt(data []byte, key []byte) ([]byte, error)

AesDecrypt 解密 解密过程相反 16,24,32位字符串的话,分别对应AES-128,AES-192,AES-256 加密方法

func AesEncrypt

func AesEncrypt(data []byte, key []byte) ([]byte, error)

AesEncrypt 加密 加密过程:

1、处理数据,对数据进行填充,采用PKCS7(当密钥长度不够时,缺几位补几个几)的方式。
2、对数据进行加密,采用AES加密方法中CBC加密模式
3、对得到的加密数据,进行base64加密,得到字符串

func CompressFileName added in v0.1.7

func CompressFileName(filePath string) string

func DecompressFile added in v0.1.7

func DecompressFile(filePath, destDir string) error

func DecryptByAes

func DecryptByAes(data string) ([]byte, error)

DecryptByAes Aes 解密

func DecryptFile

func DecryptFile(sourceFile, destFile string) (err error)

DecryptFile 文件解密

func EncryptByAes

func EncryptByAes(data []byte) (string, error)

EncryptByAes Aes加密 后 base64 再加

func EncryptFile

func EncryptFile(filePath, fName string) (err error)

更新 文件 的加解密 EncryptFile 文件加密,filePath 需要加密的文件路径 ,fName加密后文件名

func GetAbPathByCaller added in v0.1.7

func GetAbPathByCaller() string

func GetFilesBySuffix added in v0.1.7

func GetFilesBySuffix(path string, suffix string) []string

func GetParentPath added in v0.1.7

func GetParentPath(srcPath string) string

func MoveChildToParent

func MoveChildToParent(dirPath string) error

func String2Md5 added in v0.1.7

func String2Md5(data 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