util

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: MIT Imports: 12 Imported by: 0

README

util

utilities in Go

go get -u github.com/harryzhu/util

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EncUsername string
	EncPassword string
)

PwdKey length can be 16,24,32

View Source
var PwdKey = []byte("This(*Key*)@2021This(*Key*)@2021")

Functions

func AesDeCrypt

func AesDeCrypt(cypted []byte, key []byte) ([]byte, error)

func AesEcrypt

func AesEcrypt(origData []byte, key []byte) ([]byte, error)

func DePwdCode

func DePwdCode(pwd string) ([]byte, error)

func EnPwdCode

func EnPwdCode(pwd []byte) (string, error)

func GetFileContent

func GetFileContent(src string) (body []byte, err error)

func GetMD5

func GetMD5(s string) string

func GetUrlContent

func GetUrlContent(src string) (body []byte, err error)

func PKCS7Padding

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

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) ([]byte, error)

func ParseAccessKey

func ParseAccessKey(s string) (username, password string)

func SaveFile

func SaveFile(fpath string, fcontent []byte) (err error)

func ShowAccessKey

func ShowAccessKey()

func SliceUnique

func SliceUnique(lines []string) (lines_unique []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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