addrportxorv2

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidKeyLength = errors.New("invalid key length")
	ErrInvalidKey       = errors.New("invalid key")
)

Functions

func Encode

func Encode(addrPort string, xorKey []byte) (net.IP, error)

Encode encodes the given address, port and XOR encryption details in an IPv6 formatted slice of bytes.

Types

type AddrPortXORV2

type AddrPortXORV2 struct {
	AddrPort netip.AddrPort
	XORKey   []byte
}

AddrPortXORV2 is used by the Decode function to encapsulate the returned values.

func Decode

func Decode(ip net.IP) (*AddrPortXORV2, error)

Decode assumes an IPv4 address and port and a 1-6 bytes long key, has been encoded within the IPv6 address. It returns a netip.AddrPort with the information.

Jump to

Keyboard shortcuts

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