sickocommon

package module
v0.0.0-...-7813298 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: MIT Imports: 35 Imported by: 0

README

��# psycho-common

License

sickocommon is under the MIT license. See the LICENSE file for details.

Documentation

Overview

stolen this from https://github.com/austinh115/lz-string-go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecodeStr

func AESDecodeStr(crypt, key string) string

func AESEncodeStr

func AESEncodeStr(src, key string) string

func BASE64DecodeStr

func BASE64DecodeStr(src string) string

base decode to string

func BASE64EncodeStr

func BASE64EncodeStr(src string) string

base encode to string

func CheckSliceContains

func CheckSliceContains(slice []string, item string) bool

func CopyFile

func CopyFile(src, dst string, force bool) error

func GetAppdataPath

func GetAppdataPath() string

func GetCpuID

func GetCpuID() string

GetCpuID : Get CPU ID

func GetMACAddress

func GetMACAddress() (string, error)

GetMACAddress : Get PC MAC address

func GetMd5String

func GetMd5String(s string, upper bool, half bool) string

GetMd5String : 生成32位md5字串

func GetParsedCookie

func GetParsedCookie(cookie []*http.Cookie) string

GetParsedCookie : Handle Cookie From Response

func GetRawProxy

func GetRawProxy(proxylist []string) string

GetRawProxy : GetRawProxy

func HMAC_SHA1

func HMAC_SHA1(src, key string) string

func HMAC_SHA256

func HMAC_SHA256(src, key string) string

hmacsha256

func HMAC_SHA512

func HMAC_SHA512(src, key string) string

hmacsha512

func Hhex2Int

func Hhex2Int(hexStr string) uint64

func IsEmpty

func IsEmpty(s string) bool

func Jig

func Jig(src string) string

func LZCompress

func LZCompress(uncompressed string, keyStrBase64 string) string

func LZDecompress

func LZDecompress(input string, keyStrBase64 string) (string, error)

func MD5Str

func MD5Str(src string) string

md5

func NewPool

func NewPool() *redis.Pool

NewPool : Create Redis Pool recycle connections

func NikeUUID

func NikeUUID() string

func PKCS5Padding

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

func PKCS5Trimming

func PKCS5Trimming(encrypt []byte) []byte

func PackCookiesToString

func PackCookiesToString(cks map[string]http.Cookie) string

func ParseCookiesFromHeader

func ParseCookiesFromHeader(cookies []string) map[string]http.Cookie

解析setCookie

func ParseSetCookieSingle

func ParseSetCookieSingle(str string) http.Cookie

func PathCheckAndCreate

func PathCheckAndCreate(s string, perm os.FileMode) error

func PathExists

func PathExists(path string) (bool, error)

func RandMapObject

func RandMapObject(m interface{}) interface{}

func RandSliceObject

func RandSliceObject(s interface{}) interface{}

func RandSliceString

func RandSliceString(s []string) string

func RandStringWithSetLength

func RandStringWithSetLength(n int) string

func RandomChineseCharacterN

func RandomChineseCharacterN(length int) string

func ReadJson

func ReadJson(f string, data interface{}) error

func RsaDecrypt

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

解密

func RsaEncrypt

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

加密

func SHA256Str

func SHA256Str(src string) string

sha256

func SHA512Str

func SHA512Str(src string) string

sha512

func ShuffleSlice

func ShuffleSlice(s interface{})

func UniqueID

func UniqueID() string

UniqueID : 利用随机数生成Guid字串

func WriteJson

func WriteJson(f string, data interface{}, perm os.FileMode) error

Types

type Proxy

type Proxy struct {
	Host     string    `json:"host"`
	Port     string    `json:"port"`
	Username string    `json:"username,omitempty"`
	Password string    `json:"password,omitempty"`
	NeedAuth bool      `json:"need_auth,omitempty"`
	Protocol ProxyType `json:"protocol,omitempty"`
}

func GetProxy

func GetProxy(proxylist []string) *Proxy

GetProxy : GetProxy

func (Proxy) String

func (p Proxy) String() string

type ProxyType

type ProxyType string
var (
	ProxySocks5 ProxyType = "socks5"
	ProxySocks4 ProxyType = "socks4"
	ProxyHTTPS  ProxyType = "https"
	ProxyHTTP   ProxyType = "http"
)

func GetProxyTypes

func GetProxyTypes() []ProxyType

GetProxyTypes : GetProxyTypes

Jump to

Keyboard shortcuts

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