common

package
v0.0.0-...-e5d0cd3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Alphabet = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789"
View Source
const Alphabet64Grpc = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789_."

Variables

View Source
var Base62Encoder, _ = basex.NewEncoding(Alphabet)
View Source
var Base64GrpcEncoder, _ = basex.NewEncoding(Alphabet64Grpc)
View Source
var IntSize = 32 << (^uint(0) >> 63)

Functions

func Abs64

func Abs64(a int64) int64

func Base64StdDecode

func Base64StdDecode(s string) (string, error)

func Base64UrlDecode

func Base64UrlDecode(s string) (string, error)

func BoolToString

func BoolToString(b bool) string

func BytesIncBigEndian

func BytesIncBigEndian(b []byte)

func BytesIncLittleEndian

func BytesIncLittleEndian(b []byte)

func Deduplicate

func Deduplicate(list []string) []string

func EVPBytesToKey

func EVPBytesToKey(password string, keyLen int) (key []byte)

func GenerateCertChainHash

func GenerateCertChainHash(rawCerts [][]byte) (chainHash []byte)

func GetTagFromLinkLikePlaintext

func GetTagFromLinkLikePlaintext(link string) (tag string, afterTag string)

func HeadOverlap

func HeadOverlap(p, b []byte) bool

func HmacMD5

func HmacMD5(key []byte, data []byte) []byte

func HmacSHA1

func HmacSHA1(key []byte, data []byte) []byte

func MD5Sum

func MD5Sum(d []byte) []byte

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

func ResolveUDPAddr

func ResolveUDPAddr(resolver *net.Resolver, hostport string) (*net.UDPAddr, error)

func SHA1Sum

func SHA1Sum(d []byte) []byte

func SetValue

func SetValue(values *url.Values, key string, value string)

func StringToUUID5

func StringToUUID5(str string) string

StringToUUID5 is from https://github.com/XTLS/Xray-core/issues/158

func StringsHas

func StringsHas(strs []string, str string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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