tools

package
v0.0.0-...-084929d Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Random = rand.New(rand.NewSource(time.Now().Unix()))

Functions

func Bytes2str

func Bytes2str(b []byte) string

数组转字符串

func Cookies2Str

func Cookies2Str(cookies []*http.Cookie) string

func HmacSHA1

func HmacSHA1(key string, data string) string

func Md5

func Md5(sile []byte) []byte

[16]byte

func Md5Hex

func Md5Hex(sile []byte) string

[32]byte

func NewECBDecrypter

func NewECBDecrypter(b cipher.Block) cipher.BlockMode

NewECBDecrypter returns a BlockMode which decrypts in electronic code book mode, using the given Block.

func NewECBEncrypter

func NewECBEncrypter(b cipher.Block) cipher.BlockMode

NewECBEncrypter returns a BlockMode which encrypts in electronic code book mode, using the given Block.

func PKCS7Padding

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

使用PKCS7进行填充,IOS也是7

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

func RandChar

func RandChar(size int) string

随机生成字符串

func RandomBytes

func RandomBytes(n int64) []byte

生成随机字节

func RandomBytesReader

func RandomBytesReader(n int64) *strings.Reader

随机生成字节读取器

func RangeRand

func RangeRand(min, max int64) int64

随机生成 [m,n) 范围内随机数

func SHA1

func SHA1(sile []byte) []byte

func SHA1Hex

func SHA1Hex(sile []byte) string

func Str2Cookie

func Str2Cookie(cookie string) (cookies []*http.Cookie)

字符串cookie拆分

func Str2bytes

func Str2bytes(s string) []byte

字符串转数组

func ZeroPadding

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

func ZeroUnPadding

func ZeroUnPadding(origData []byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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