Representation of an IPv6 address. Provides various utilities methods like equality checking.
Avoid direct instantiation; use ipv6.address instead.
The address as a bigint
Because the representation of an IPv6 address is too large to fit into a typical JavaScript integer, a https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt is used instead.
Compares if two IPv6 addresses are the same.
import { ipv6 as ip } from 'cidr-block'function isLoopback(address: Ipv6Representable) { return ip.address(address).equals('::1')}@public@param otherIpAddress the other Ipv6 address to compare@returns if the other IP address is the same
Calculates the next logical IPv6 address.
import { ipv6 as ip } from 'cidr-block'const myIp = ip.address('2001:0db8::ac10')myIp.nextIp() // ==> '2001:0db8::ac11'
Calculates the previous logical IPv6 address.
import { ipv6 as ip } from 'cidr-block'const myIp = ip.address('2001:0db8::ac10')myIp.previousIp() // ==> '2001:0db8::ac09'
Returns the string representation of the address
Generated using TypeDoc
Representation of an IPv6 address. Provides various utilities methods like equality checking.
Avoid direct instantiation; use ipv6.address instead.