Documentation ¶
Overview ¶
Package ipconv provides basic conversion between IP addresses representations. Converter does not require additional settings.
Index ¶
- Variables
- func BigIntToIPv6(ipaddr big.Int) net.IP
- func IPv4ToInt(ipaddr net.IP) (uint32, error)
- func IPv6ToBigInt(ipaddr net.IP) (*big.Int, error)
- func IPv6ToInt(ipaddr net.IP) ([2]uint64, error)
- func IntToIPv4(ipaddr uint32) net.IP
- func IntToIPv6(high, low uint64) net.IP
- func ParseIP(s string) (net.IP, int, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidIPAddress = errors.New("invalid ip address")
View Source
var ErrNotIPv4Address = errors.New("not an IPv4 addres")
View Source
var ErrNotIPv6Address = errors.New("not an IPv6 addres")
Functions ¶
func BigIntToIPv6 ¶ added in v1.0.1
BigIntToIPv6 converts IP address of version 6 from big integer to net.IP representation.
func IPv6ToBigInt ¶
IPv6ToBigInt converts IP address of version 6 from net.IP to math big integer representation.
func IPv6ToInt ¶
IPv6ToInt converts IP address of version 6 from net.IP to uint64 array representation. Return value contains high integer value on the first place and low integer value on second place.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.