utils

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: LGPL-2.1 Imports: 9 Imported by: 0

Documentation

Overview

Package utils A functions of utils.

Index

Constants

View Source
const (
	// GBK ...
	GBK string = "GBK"
	// UTF8 ...
	UTF8 string = "UTF8"
	// UNKNOWN ...
	UNKNOWN string = "UNKNOWN"
)

Variables

This section is empty.

Functions

func AesDecryption added in v1.0.2

func AesDecryption(key, iv, cipherText []byte) ([]byte, error)

AesDecryption ...

func AesEncryption added in v1.0.2

func AesEncryption(key, iv, plainText []byte) ([]byte, error)

AesEncryption ...

func GetStringEncoding

func GetStringEncoding(dataStr string) string

GetStringEncoding determine string encoding, UTF8 or GBK or UNKNOWN

func IsGBK

func IsGBK(data []byte) bool

IsGBK determine GBK encoding

func IsUTF8

func IsUTF8(data []byte) bool

IsUTF8 determine UTF8 encoding

func PKCS5Padding added in v1.0.2

func PKCS5Padding(src []byte, blockSize int) []byte

PKCS5Padding ...

func PKCS5UnPadding added in v1.0.2

func PKCS5UnPadding(src []byte) []byte

PKCS5UnPadding ...

func UTF82GBK

func UTF82GBK(src string) ([]byte, error)

UTF82GBK convert UTF8 to GBK

Types

type Stack added in v1.0.4

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

Stack ...

func NewStack added in v1.0.4

func NewStack() *Stack

NewStack ...

func (*Stack) Empty added in v1.0.4

func (stack *Stack) Empty() bool

Empty ...

func (*Stack) Len added in v1.0.4

func (stack *Stack) Len() int

Len ...

func (*Stack) Peak added in v1.0.4

func (stack *Stack) Peak() interface{}

Peak ...

func (*Stack) Pop added in v1.0.4

func (stack *Stack) Pop() interface{}

Pop ...

func (*Stack) Push added in v1.0.4

func (stack *Stack) Push(value interface{})

Push ...

Jump to

Keyboard shortcuts

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