Creates a new IPv4 address from four octets.
The first octet.
The second octet.
The third octet.
The fourth octet.
Creates a new IPv4 address from an integer value.
The integer representation of the IPv4 address.
ReadonlyfamilyThe address family identifier for IPv4 addresses.
Static ReadonlyBITSThe number of bits in an IPv4 address.
Static ReadonlyBROADCASTThe broadcast address 255.255.255.255.
Static ReadonlyLOCALHOSTThe localhost address 127.0.0.1.
Static ReadonlyUNSPECIFIEDThe unspecified address 0.0.0.0.
Gets the raw integer representation of the IPv4 address.
Checks whether this address is in the benchmarking range.
true when the address is in 198.18.0.0/15, otherwise false.
Checks whether this address is the broadcast address.
true when the address is 255.255.255.255, otherwise false.
Checks whether this address is in a documentation-only range.
true for 192.0.2.0/24, 198.51.100.0/24, or 203.0.113.0/24; otherwise false.
Checks whether this address is globally reachable.
true when the address is not in any special non-global range.
Checks whether this address is link-local.
true when the address is in 169.254.0.0/16, otherwise false.
Checks whether this address is a loopback address.
true when the address is in 127.0.0.0/8, otherwise false.
Checks whether this address is a multicast address.
true when the address is in 224.0.0.0/4, otherwise false.
Checks whether this address is in a private-use range.
true for 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16; otherwise false.
Checks whether this address is in the reserved range.
true when the address is in 240.0.0.0/4 except the broadcast address.
Checks whether this address is in the shared Carrier-Grade NAT range.
true when the address is in 100.64.0.0/10, otherwise false.
Checks whether this address is the unspecified address.
true when the address is 0.0.0.0, otherwise false.
Encodes this address to a 4-byte buffer.
OptionallittleEndian: booleanAn ArrayBuffer containing the IPv4 integer value.
Gets the four octets of this IPv4 address.
An array containing the four octets [num1, num2, num3, num4].
StaticfromCreates an IPv4 address from dotted-decimal text.
A successful CoreResult with an Ipv4Addr, or an TypeError when the input is invalid.
StaticfromCreates an IPv4 address from a 4-byte buffer.
OptionallittleEndian: booleanA successful CoreResult with an Ipv4Addr, or an Error when the buffer cannot be read.
StaticfromCreates an IPv4 address from a 4-byte buffer and throws an error if the buffer cannot be read.
The 4-byte buffer containing the IPv4 address.
OptionallittleEndian: boolean
Whether the buffer is in little-endian format. Defaults to false (big-endian).
The Ipv4Addr instance.
Staticfrom
Represents an IPv4 address.
Example
Since
v0.0.1