cidr

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountAddresses

func CountAddresses(inputCIDR string) uint64

CountAddresses calculates the number of addresses within the given CIDR. If the given CIDR is in fact an IP (includes no /), 1 will bne returned. If the number of addresses overflows an unsigned 64-bit int, the maximum value of an unsigned 64-bit int will be returned.

func IsPublic

func IsPublic(cidr string) bool

IsPublic returns true if a provided IP is outside of the designated public ranges, or true if either of the min/max addresses of a provided CIDR are outside of these ranges.

Types

This section is empty.

Jump to

Keyboard shortcuts

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