encrypt

package
v1.0.15-0...-55ead4f Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RAND_NUM   = 0 // 纯数字
	RAND_LOWER = 1 // 小写字母
	RAND_UPPER = 2 // 大写字母
	RAND_ALL   = 3 // 数字、大小写字母
)

Variables

This section is empty.

Functions

func Ase256

func Ase256(plaintext string, key string, iv string, blockSize int) string

func Ase256Decode

func Ase256Decode(cipherText string, encKey string, iv string) (decryptedString string)

func GenRandCode

func GenRandCode(inviteCodeLen int, targetKind int) string

生成随机码

func Hash

func Hash(str string) (hash string)

func MD5

func MD5(data []byte) string

生成32位md5字串[小写]

func PKCS5Padding

func PKCS5Padding(ciphertext []byte, blockSize int, after int) []byte

func RandNum

func RandNum(start, end int) int

生成[start,end)随机数

func RsaDecrypt

func RsaDecrypt(ciphertext []byte, privateKey string) ([]byte, error)

解密

func RsaEncrypt

func RsaEncrypt(origData []byte, publicKey string) ([]byte, error)

加密

Types

This section is empty.

Jump to

Keyboard shortcuts

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