Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Ipv6Address

Representation of an IPv6 address. Provides various utilities methods like equality checking.

remarks

Avoid direct instantiation; use ipv6.address instead.

Hierarchy

  • Ipv6Address

Index

Constructors

Properties

Accessors

Methods

Constructors

Properties

_address: bigint

Accessors

  • get address(): bigint

Methods

  • Compares if two IPv6 addresses are the same.

    example
    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

    Parameters

    Returns boolean

  • Calculates the next logical IPv6 address.

    example
    import { ipv6 as ip } from 'cidr-block'

    const myIp = ip.address('2001:0db8::ac10')
    myIp.nextIp() // ==> '2001:0db8::ac11'

    Returns Ipv6Address

  • Calculates the previous logical IPv6 address.

    example
    import { ipv6 as ip } from 'cidr-block'

    const myIp = ip.address('2001:0db8::ac10')
    myIp.previousIp() // ==> '2001:0db8::ac09'

    Returns Ipv6Address

  • toString(): string
  • Returns the string representation of the address

    Returns string

Generated using TypeDoc