Represents an IPv6 address

Param

An IPv6 address string

Param

How many octets to parse

Example

var address = new Address6('2001::/32');

Hierarchy

  • Address6

Constructors

  • Parameters

    • address: string
    • Optional optionalGroups: number

    Returns Address6

Properties

address: string
address4?: Address4
addressMinusSuffix: string
elidedGroups?: number
elisionBegin?: number
elisionEnd?: number
groups: number
isCorrect: ((this: Address4 | Address6) => boolean)

Type declaration

    • (this: Address4 | Address6): boolean
    • Returns true if the address is correct, false otherwise

      Memberof

      Address6

      Instance

      Returns

      Parameters

      Returns boolean

isInSubnet: ((this: Address4 | Address6, address: Address4 | Address6) => boolean)

Type declaration

parsedAddress: string[]
parsedAddress4?: string
parsedSubnet: string
subnet: string
subnetMask: number
v4: boolean
zone: string

Methods

  • Helper function getting end address.

    Memberof

    Address6

    Instance

    Returns

    Returns BigInteger

  • Helper function getting start address.

    Memberof

    Address6

    Instance

    Returns

    Returns BigInteger

  • Return the address as a BigInteger

    Memberof

    Address6

    Instance

    Returns

    Returns BigInteger

  • Return a zero-padded base-2 string representation of the address

    Memberof

    Address6

    Instance

    Returns

    Example

    var address = new Address6('2001:4860:4001:803::1011');
    address.binaryZeroPad();
    // '0010000000000001010010000110000001000000000000010000100000000011
    // 0000000000000000000000000000000000000000000000000001000000010001'

    Returns string

  • Return the canonical form of the address

    Memberof

    Address6

    Instance

    Returns

    Returns string

  • Return the correct form of the address

    Memberof

    Address6

    Instance

    Returns

    Returns string

  • Return the decimal form of the address

    Memberof

    Address6

    Instance

    Returns

    Returns string

  • The last address in the range given by this address' subnet Often referred to as the Broadcast

    Memberof

    Address6

    Instance

    Returns

    Returns Address6

  • The last host address in the range given by this address's subnet ie the last address prior to the Broadcast Address

    Memberof

    Address6

    Instance

    Returns

    Returns Address6

  • Return the bits in the given range as a BigInteger

    Memberof

    Address6

    Instance

    Returns

    Parameters

    • start: number
    • end: number

    Returns BigInteger

  • Return the bits in the given range as a base-16 string

    Memberof

    Address6

    Instance

    Returns

    Parameters

    • start: number
    • end: number

    Returns string

  • Return the bits in the given range as a base-2 string

    Memberof

    Address6

    Instance

    Returns

    Parameters

    • start: number
    • end: number

    Returns string

  • Return the bits that are set past the subnet mask length

    Memberof

    Address6

    Instance

    Returns

    Returns string

  • Return the scope of the address

    Memberof

    Address6

    Instance

    Returns

    Returns string

  • Return the type of the address

    Memberof

    Address6

    Instance

    Returns

    Returns string

  • Groups an address

    Returns

    Returns string

  • Returns

    the address in link form with a default port of 80

    Parameters

    • Optional optionalPort: string | number

    Returns string

  • Return an object containing the 6to4 properties of the address

    Memberof

    Address6

    Instance

    Returns

    Returns SixToFourProperties

  • Return an object containing the Teredo properties of the address

    Memberof

    Address6

    Instance

    Returns

    Returns TeredoProperties

  • Returns true if the address is a v4-in-v6 address, false otherwise

    Memberof

    Address6

    Instance

    Returns

    Returns boolean

  • Returns true if the address is a 6to4 address, false otherwise

    Memberof

    Address6

    Instance

    Returns

    Returns boolean

  • Returns true if the address is in the canonical form, false otherwise

    Memberof

    Address6

    Instance

    Returns

    Returns boolean

  • Returns true if the address is a link local address, false otherwise

    Memberof

    Address6

    Instance

    Returns

    Returns boolean

  • Returns true if the address is a loopback address, false otherwise

    Memberof

    Address6

    Instance

    Returns

    Returns boolean

  • Returns true if the address is a multicast address, false otherwise

    Memberof

    Address6

    Instance

    Returns

    Returns boolean

  • Returns true if the address is a Teredo address, false otherwise

    Memberof

    Address6

    Instance

    Returns

    Returns boolean

  • Returns

    a link suitable for conveying the address via a URL hash

    Parameters

    • Optional options: {
          className?: string;
          prefix?: string;
          v4?: boolean;
      }
      • Optional className?: string
      • Optional prefix?: string
      • Optional v4?: boolean

    Returns string

  • Return the first n bits of the address, defaulting to the subnet mask

    Memberof

    Address6

    Instance

    Returns

    the first n bits of the address as a string

    Parameters

    • Optional mask: number

      the number of bits to mask

    Returns string

  • Return the Microsoft UNC transcription of the address

    Memberof

    Address6

    Instance

    Returns

    the Microsoft UNC transcription of the address

    Returns string

  • Parameters

    • address: string

    Returns string[]

  • Parameters

    • address: string

    Returns string

  • Return the number of possible subnets of a given size in the address

    Memberof

    Address6

    Instance

    Returns

    Parameters

    • Optional subnetSize: number

    Returns string

  • Generate a regular expression that can be used to find or validate all variations of this address.

    Memberof

    Address6

    Instance

    Returns

    Parameters

    • this: Address6
    • Optional substringSearch: boolean

    Returns RegExp

  • Generate a regular expression string that can be used to find or validate all variations of this address

    Memberof

    Address6

    Instance

    Returns

    Parameters

    • this: Address6
    • Optional substringSearch: boolean

    Returns string

  • Return the reversed ip6.arpa form of the address

    Memberof

    Address6

    Instance

    Returns

    Parameters

    Returns string

  • The first address in the range given by this address' subnet Often referred to as the Network Address.

    Memberof

    Address6

    Instance

    Returns

    Returns Address6

  • The first host address in the range given by this address's subnet ie the first address after the Network Address

    Memberof

    Address6

    Instance

    Returns

    Returns Address6

  • Return the last two groups of this address as an IPv4 address string

    Memberof

    Address6

    Instance

    Returns

    Example

    var address = new Address6('2001:4860:4001::1825:bf11');
    address.to4().correctForm(); // '24.37.191.17'

    Returns Address4

  • Return the v4-in-v6 form of the address

    Memberof

    Address6

    Instance

    Returns

    Returns string

  • Return a v6 6to4 address from a v6 v4inv6 address

    Memberof

    Address6

    Instance

    Returns

    Returns null | Address6

  • Return a byte array

    Memberof

    Address6

    Instance

    Returns

    Returns number[]

  • Return an unsigned byte array

    Memberof

    Address6

    Instance

    Returns

    Returns number[]

  • Create an IPv6-mapped address given an IPv4 address

    Memberof

    Address6

    Static

    Returns

    Example

    var address = Address6.fromAddress4('192.168.0.1');
    address.correctForm(); // '::ffff:c0a8:1'
    address.to4in6(); // '::ffff:192.168.0.1'

    Parameters

    • address: string

      An IPv4 address string

    Returns Address6

  • Return an address from ip6.arpa form

    Memberof

    Address6

    Static

    Returns

    Example

    var address = Address6.fromArpa(e.f.f.f.3.c.2.6.f.f.f.e.6.6.8.e.1.0.6.7.9.4.e.c.0.0.0.0.1.0.0.2.ip6.arpa.)
    address.correctForm(); // '2001:0:ce49:7601:e866:efff:62c3:fffe'

    Parameters

    • arpaFormAddress: string

      an 'ip6.arpa' form address

    Returns Address6

  • Convert a BigInteger to a v6 address object

    Memberof

    Address6

    Static

    Returns

    Example

    var bigInteger = new BigInteger('1000000000000');
    var address = Address6.fromBigInteger(bigInteger);
    address.correctForm(); // '::e8:d4a5:1000'

    Parameters

    • bigInteger: BigInteger

      a BigInteger to convert

    Returns Address6

  • Convert a byte array to an Address6 object

    Memberof

    Address6

    Static

    Returns

    Parameters

    • bytes: any[]

    Returns Address6

  • Convert a URL (with optional port number) to an address object

    Memberof

    Address6

    Static

    Example

    var addressAndPort = Address6.fromURL('http://[ffff::]:8080/foo/');
    addressAndPort.address.correctForm(); // 'ffff::'
    addressAndPort.port; // 8080

    Parameters

    • url: string

      a URL with optional port number

    Returns {
        address: null;
        error: string;
        port: null;
    } | {
        address: Address6;
        error?: undefined;
        port: null | number;
    }

  • Convert an unsigned byte array to an Address6 object

    Memberof

    Address6

    Static

    Returns

    Parameters

    • bytes: any[]

    Returns Address6

  • Parameters

    • address: string

    Returns boolean

Generated using TypeDoc