tools

package
v0.0.0-...-4d93f28 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: LGPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareTwoByteSlices

func CompareTwoByteSlices(s1, s2 []byte) bool

Returns true if the two byte slices match identically.

func ConvertClientTypeByteToStr

func ConvertClientTypeByteToStr(b byte) string

func ConvertClientTypeStrToByte

func ConvertClientTypeStrToByte(CType string) (byte, error)

func ConvertProtoByteToStr

func ConvertProtoByteToStr(b byte) string

The opposite of ConvertProtoStrToByte - converts a byte to a string. If there is no mapping we will return an empty string.

func ConvertProtoStrToByte

func ConvertProtoStrToByte(proto string) (byte, error)

Returns the byte value of the protocol according to: https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml. If unsupported protocol, we will return an error.

func ConvertSignatureMethodByteToStr

func ConvertSignatureMethodByteToStr(b byte) string

Converts a signature method constant to a string.

func ElementInSlice

func ElementInSlice(elm byte, slice []byte) bool

Checks if byte element is present in the byte slice, returns a boolean.

func IsIPv6

func IsIPv6(ip string) (bool, error)

Returns if the ip parameter string is an IPv6 address. In case there is no error, false signifies that it is an IPv4 address and true signifies that is is an IPv6 address.

func PortCanBeZero

func PortCanBeZero(protocol byte) bool

Returns if the port can be equal to zero for the specified protocol.

Types

This section is empty.

Jump to

Keyboard shortcuts

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