cipher

package
v0.0.0-...-d50afe8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Byte

func Base64Byte(data []byte) string

对数据进行Base64编码

func Base64Decoded

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

对数据进行Base64解码

func CRC32Data

func CRC32Data(data []byte) uint32

对字节数组进行CRC加密并返回其结果。

func CRC32String

func CRC32String(str string) uint32

对字符串进行CRC加密并返回其结果。

func MD5Data

func MD5Data(data []byte) string

对字节数组进行MD5加密并返回其结果。

func MD5String

func MD5String(str string) string

对字符串进行MD5加密并返回其结果。

func SHA1Data

func SHA1Data(data []byte) string

对字节数组进行SHA1加密并返回其结果。

func SHA1String

func SHA1String(str string) string

对字符串进行SHA1加密并返回其结果。

func SHA256Data

func SHA256Data(data []byte) string

对字节数组进行SHA256加密并返回其结果。

func SHA256String

func SHA256String(str string) string

对字符串进行SHA256加密并返回其结果。

Types

type RSA

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

RSA数据结构

func NewRsaEr

func NewRsaEr(publicKeyAndPrivateKey ...[]byte) *RSA

创建一个新的RSA助手

func (*RSA) GenRsaKey

func (slf *RSA) GenRsaKey(keyLength int) error

发布一对新的密钥,原有密钥失效

func (*RSA) GetPrivateKey

func (slf *RSA) GetPrivateKey() []byte

获取私钥

func (*RSA) GetPublicKey

func (slf *RSA) GetPublicKey() []byte

获取公钥

func (*RSA) RsaDecrypt

func (slf *RSA) RsaDecrypt(ciphertext []byte) ([]byte, error)

Rsa解密

func (*RSA) RsaEncrypt

func (slf *RSA) RsaEncrypt(origData []byte) ([]byte, error)

Rsa加密

Jump to

Keyboard shortcuts

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