Options
All
  • Public
  • Public/Protected
  • All
Menu

Class IPv6Prefix

Represents the prefix portion in the CIDR notation for representing IP ranges

The IPv6 prefix portion represents the mask. It is the number of continuous bits turned on (with value 1) counting from the left side of an 128 bit value.

{@see https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing} for more information on CIDR

Hierarchy

  • IPv6Prefix

Implements

Index

Constructors

constructor

  • Constructor for an instance of IPv6 prefix from a decimal number

    Parameters

    • rawValue: number

      the decimal value to construct the IPv6 prefix from.

    Returns IPv6Prefix

    the instance of an IPv6 prefix

Properties

Private bitValue

bitValue: BigInteger = bigInt(128)

value

value: number

The decimal value of the 16bit number representing the prefix

Methods

getValue

  • getValue(): number
  • Gets the decimal value of the IPv6 prefix

    Returns number

    the decimal value of the IPv6 prefix

merge

split

Private toHexadecatetNotation

  • toHexadecatetNotation(bits: string): string
  • Parameters

    • bits: string

    Returns string

toMask

  • Converts the IPv6 prefix to a IPv6Mask

    The IPv6 mask is the representation of the prefix in 8 groups of 16 bit values represented in hexadecimal

    Returns IPv6Mask

    the mask representation of the prefix

toRangeSize

  • toRangeSize(): BigInteger
  • Returns the size (number of IP numbers) of range of this prefix

    Returns BigInteger

    the size (number of IP numbers) of range of this prefix

toString

  • toString(): string
  • Gets the decimal value of the IPv4 prefix as string

    Returns string

    he decimal value of the IPv4 prefix as string

Static fromNumber

  • Convenience method for constructing an instance of IPv46 prefix from a decimal number

    Parameters

    • rawValue: number

      the decimal value to construct the IPv6 prefix from.

    Returns IPv6Prefix

    the instance of an IPv6 prefix

Static fromRangeSize

  • fromRangeSize(rangeSize: BigInteger): IPv6Prefix

Generated using TypeDoc