cipher

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomString

func GenerateRandomString(letterLength, numberLength int) string

GenerateRandomString 生成随机字符串, 分别指定字母和数字的长度

func MD5

func MD5(str string) string

MD5 returns the MD5 checksum of the data.

Types

type AesCipher

type AesCipher struct {
	// contains filtered or unexported fields
}

AesCipher aes加密解密

func NewAes

func NewAes(key, iv string) (*AesCipher, error)

NewAes 创建一个新的AesCipher

func (*AesCipher) DecryptBase64

func (a *AesCipher) DecryptBase64(b string) ([]byte, error)

DecryptBase64 解密

func (*AesCipher) EncryptBase64

func (a *AesCipher) EncryptBase64(origData []byte) (string, error)

EncryptBase64 加密

type AesInterface

type AesInterface interface {
	EncryptBase64(in []byte) (string, error)
	DecryptBase64(b string) ([]byte, error)
}

AesInterface aes加密解密接口

Jump to

Keyboard shortcuts

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