Constructor for an IPv4 number.
value to construct an IPv4 from. The given value can either be numeric or string. If a string is given then it needs to be in dot-decimal notation
ReadonlybitThe number of bits needed to represents the value of the IPv4 number
ReadonlymaximumThe maximum bit size (i.e. binary value) of the IPv4 number in BigInt
ReadonlyoctetsAn array of Octet's
ReadonlyseparatorThe string character used to separate the individual octets when the IPv4 is rendered as strings
ReadonlytypeThe type of IP number. Value is one of the values of the IPNumType enum
ReadonlyvalueThe decimal value represented by the IPv4 number in BigInt
Gets the numeric value of an IP number as BigInt
bigInt the numeric value of an IP number.
Checks if an IP number has a value greater than the present value
true, if there is a value greater than the present value. Returns false otherwise.
Checks if an IP number has a value lesser than the present value
true, if there is a value lesser than the present value. Returns false otherwise.
Checks if this IPv4 address is a broadcast address.
When called without arguments, checks for the limited broadcast address (255.255.255.255). When a subnet is provided, checks if this address is the directed broadcast for that subnet.
Optionalsubnet: IPv4CidrRangeOptional CIDR range to check for directed broadcast
true if this is a broadcast address, false otherwise
Checks if this IPv4 address is a documentation address according to RFC 5737.
Documentation IPv4 address ranges:
true if this IPv4 address is reserved for documentation, false otherwise
Checks if the given IP number, is equals to the current IP number
the other IP number to compare with
true if the given IP number is equals
Checks if this IPv4 address is a global unicast address.
Global unicast is defined here as "everything else" - any address that does not match the other specific address types (Unspecified, Loopback, Private, Link-Local, Documentation, Multicast, Reserved, or Broadcast).
Note that this is not a strict "publicly routable" check: it does not consult the full IANA special-purpose address registry (RFC 6890), so special-purpose ranges not covered by the checks above - such as shared address space 100.64.0.0/10 (RFC 6598) and benchmarking space 198.18.0.0/15 (RFC 2544) - still return true.
true if this IPv4 address is global unicast, false otherwise
Checks if the given IP number is greater than this current IP number
the other IP number to compare with
true if the given IP number is greater than this current one. False otherwise.
Checks if the given IP number is greater than or equals to this current IP number
the other IP number to compare with
{boolean} true if the given IP number is greater than or equals to this current one. False otherwise.
Checks if the given IP number is lesser than this current IP number
the other IP number to compare with
true if the given IP number is less than this current one. False otherwise.
Checks if the given IP number is less than or equals to this current IP number
the other IP number to compare with
true if the given IP number is less than or equals to this current one. False otherwise.
Checks if this IPv4 address is a link-local address according to RFC 6890.
Link-local IPv4 address range:
true if this IPv4 address is link-local, false otherwise
Checks if this IPv4 address is a loopback address according to RFC 5735.
Loopback IPv4 address range:
true if this IPv4 address is loopback, false otherwise
Checks if this IPv4 address is a multicast address according to RFC 1112.
Multicast IPv4 address range:
true if this IPv4 address is multicast, false otherwise
Checks if this IPv4 address is a private address according to RFC 1918.
Private IPv4 address ranges:
true if this IPv4 address is private, false otherwise
Checks if this IPv4 address is in a reserved range according to RFC 6890.
Reserved IPv4 address range:
Note: 255.255.255.255 is the limited broadcast address, not reserved.
true if this IPv4 address is reserved, false otherwise
Checks if this IPv4 address is an unspecified address according to RFC 6890.
Unspecified IPv4 address:
true if this IPv4 address is unspecified, false otherwise
Gets the binary string representation of an IP number.
the string binary representation.
Returns this IPv4 number as a IPv4-Mapped IPv6 Address
The IPv4-Mapped IPv6 Address allows an IPv4 number to be embedded within an IPv6 number
{@see https://tools.ietf.org/html/rfc4291#section-2.5.5} for more information on the IPv4-Mapped IPv6 Address
an IPv6 number with the IPv4 embedded within it
A string representation of the IPv4 number. The string representation is in dot-decimal notation
The string representation in dot-decimal notation
StaticfromStaticfromA convenience method for creating an IPv4 by providing the IP number in dot-decimal notation. E.g "10.1.1.10"
{@see https://en.wikipedia.org/wiki/Dot-decimal_notation} for more information on dot-decimal notation.
the IP number in dot-decimal notation
the IPv4 instance
StaticfromStaticfromAlias for IPv4.fromDecimalDottedString.
the IP number in dot-decimal notation
the IPv4 instance
Represents an IPv4 number. A 32 bit number that is used to uniquely identify a device that is part of a computer network that uses the internet protocol for communication.
See