utils

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: AGPL-3.0 Imports: 5 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ASCIIBytesToPrintString

func ASCIIBytesToPrintString(b []byte) string

ASCIIBytesToPrintString converts the buffer b to the closest ASCII string equivalent, substituting '*' for unprintable characters.

func CtIsZero

func CtIsZero(b []byte) bool

CtIsZero returns true iff the buffer b is all 0x00, doing the check in constant time.

func EnsureAddrIPPort

func EnsureAddrIPPort(a string) error

EnsureAddrIPPort returns nil iff the address is a raw IP + Port combination.

func ExplicitBzero

func ExplicitBzero(b []byte)

ExplicitBzero explicitly clears out the buffer b, by filling it with 0x00 bytes.

func GetExternalIPv4Address

func GetExternalIPv4Address() (net.IP, error)

GetExternalIPv4Address attempts to guess an external IPv4 address by interface enumeration.

func MkDataDir

func MkDataDir(f string) error

MkDataDir creates a data directory of appropriate (paranoid) permissions if it does not exist, and validates that existing directories have the intended permissions if it does exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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