util

package
v0.0.0-...-9e5c6c4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(cryted string, key string) ([]byte, error)

func AesEncrypt

func AesEncrypt(origData []byte, key string) (string, error)

https://tech.mojotv.cn/2019/06/28/golang-crypt#svekr key length must be 16/24/32

func BrowserOpen

func BrowserOpen(url string) error

func DesDecrypt

func DesDecrypt(decrypted string, key []byte) (string, error)

func DesEncrypt

func DesEncrypt(text string, key []byte) (string, error)

func PKCS7Padding

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

补码

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

去码

func RandStringDigit

func RandStringDigit(n int) string

func RandStringWordC

func RandStringWordC(n int) string

func RandStringWordL

func RandStringWordL(n int) string

func RandStringWordU

func RandStringWordU(n int) string

func RandomString

func RandomString(n int) string

func ZeroPadding

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

func ZeroUnPadding

func ZeroUnPadding(origData []byte) []byte

Types

type CfIP

type CfIP struct {
	Ipv4Cidrs    []string `json:"ipv4_cidrs"`
	Ipv6Cidrs    []string `json:"ipv6_cidrs"`
	ReachableIPs chan string
}

func NewCfIP

func NewCfIP() (*CfIP, error)

func (CfIP) AllIps

func (ci CfIP) AllIps(fn func(ip, cidr string))

func (CfIP) IsCf

func (ci CfIP) IsCf(ip net.IP) bool

type GeoIP

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

func NewGeoIP

func NewGeoIP(geoIpFilePath string) (*GeoIP, error)

func (*GeoIP) Close

func (g *GeoIP) Close() error

func (*GeoIP) Country

func (g *GeoIP) Country(host string) (isoCountryCode string, err error)

type SchemaVLESS

type SchemaVLESS struct {
	DstProtocol string //tcp or udp

	Version byte
	// contains filtered or unexported fields
}

func (SchemaVLESS) AddrUdp

func (h SchemaVLESS) AddrUdp() *net.UDPAddr

func (SchemaVLESS) DataTcp

func (h SchemaVLESS) DataTcp() []byte

func (SchemaVLESS) DataUdp

func (h SchemaVLESS) DataUdp() []byte

func (SchemaVLESS) HostIP

func (h SchemaVLESS) HostIP() net.IP

func (SchemaVLESS) HostPort

func (h SchemaVLESS) HostPort() string

func (SchemaVLESS) Logger

func (h SchemaVLESS) Logger() *slog.Logger

func (SchemaVLESS) UUID

func (h SchemaVLESS) UUID() string

Jump to

Keyboard shortcuts

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