Compares two IPv4 addresses for equality.
The other IPv4 address to compare with, which can be an Ipv4Address instance or literal value.
true if both IPv4 addresses are equal
Checks if there is a next sequential IPv4 address. This would only return false if the current address is the maximum possible value (255.255.255.255).
true if there is a next IPv4 address.
Checks if there is a previous sequential IPv4 address. This would only return false if the current address is the minimum possible value (0.0.0.0).
true if there is a previous IPv4 address.
Compares if this IPv4 address is greater than another IPv4 address.
The other IPv4 address to compare with, which can be an Ipv4Address instance or literal value.
true if this IPv4 address is greater than the other IPv4 address
Compares if this IPv4 address is greater than or equal to another IPv4 address.
The other IPv4 address to compare with, which can be an Ipv4Address instance or literal value.
true if this IPv4 address is greater than or equal to the other IPv4 address
Compares if this IPv4 address is less than another IPv4 address.
The other IPv4 address to compare with, which can be an Ipv4Address instance or literal value.
true if this IPv4 address is less than the other IPv4 address
Compares if this IPv4 address is less than or equal to another IPv4 address.
The other IPv4 address to compare with, which can be an Ipv4Address instance or literal value.
true if this IPv4 address is less than or equal to the other IPv4 address
Checks if the IPv4 address is a local-link address (in the CIDR of 169.254.0.0/16).
true if the IPv4 address is a local-link address.
Checks if the IPv4 address is a loopback address (in the CIDR of 127.0.0.0/8)
true if the IPv4 address is a loopback address (example: 127.0.0.1 is true)
Checks if the IPv4 address is a multicast address (between 224.0.0.0 to 239.255.255.255).
true if the IPv4 address is a multicast address.
Checks if the IPv4 address is a private address.
This is based on RFC 1918, which defines the following private address ranges:
true if the IPv4 address is in any of the private address ranges.
Gets the next sequential IPv4 address.
The next IPv4 address, or undefined if the current address is the maximum possible value.
Gets the octets of the IPv4 address.
An array of four numbers representing the octets of the IPv4 address.
Gets the previous sequential IPv4 address.
The previous IPv4 address, or undefined if the current address is the minimum possible value.
Returns the binary string representation of the IPv4 address.
The IPv4 address as a binary string in dotted-decimal notation (example: "11000000.10111011.00000000.00000001").
Represents an IPv4 address with utility methods for manipulation and comparison.
While you can instantiate this class directly, it is recommended to use the ipv4.address shorthand method from the
ipv4namespace instead.Example: Creating addresses (prefer the shorthand)
Example: Converting between formats
Example: Comparing addresses
Example: Navigating sequential addresses
Example: Checking address types