ip-num
    Preparing search index...

    Class IPv4Prefix

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

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

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

    Implements

    Index

    Constructors

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

      Parameters

      • rawValue: bigint

        the decimal value to construct the IPv4 prefix from.

      Returns IPv4Prefix

      the instance of an IPv4 prefix

    Properties

    type: "IPv4"
    value: bigint

    The decimal value of the 8bit number representing the prefix

    Methods

    • Gets the decimal value of the IPv4 prefix

      Returns bigint

      the decimal value of the IPv4 prefix

    • Converts the IPv4 prefix to a IPv4Mask

      The IPv4 mask is the representation of the prefix in the dot-decimal notation

      Returns IPv4Mask

      the mask representation of the prefix

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

      Returns bigint

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

    • Gets the decimal value of the IPv4 prefix as string

      Returns string

      The decimal value of the IPv4 prefix as string

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

      Parameters

      • rawValue: bigint

        the decimal value to construct the IPv4 prefix from.

      Returns IPv4Prefix

      the instance of an IPv4 prefix