ip-num
    Preparing search index...

    Class RangedSet<T>

    Represents a continuous segment of either IPv4 or IPv6 numbers without adhering to classless inter-domain routing scheme for allocating IP addresses.

    Type Parameters

    Implements

    Index

    Constructors

    Properties

    bitValue: bigint

    Methods

    • Checks if this range contains the given other range.

      Parameters

      • otherRange: RangedSet<T>

        the other range to check if this range contains

      Returns boolean

    • Returns the first IP number in the range

      Returns T

    • Returns the last IP number in the range

      Returns T

    • Returns the size, which is the number of IP numbers in the range.

      Returns bigint

    • Checks if this range is inside another range.

      Parameters

      • otherRange: RangedSet<T>

        the other range to check if this range is inside of.

      Returns boolean

    • Check if this range can be converted to a CIDR range.

      Returns boolean

    • Checks if this range is consecutive with another range.

      This means if the two ranges can be placed side by side, without any gap. Hence Equal or ranges contained inside one another, or overlapping ranges are not considered as consecutive.

      Parameters

      • otherRange: RangedSet<T>

        the other range to check if this range is consecutive to.

      Returns boolean

    • Check if this range is equal to the given other range.

      Parameters

      • otherRange: RangedSet<T>

        the other range to check if equal to this range.

      Returns boolean

    • Check if this range is greater than the given range.

      Parameters

      • otherRange: RangedSet<T>

        the other range to check if greater than.

      Returns boolean

    • Check if this range is less than the given range.

      Parameters

      • otherRange: RangedSet<T>

        the other range to check if less than.

      Returns boolean

    • Checks of this range overlaps with a given other range.

      This means it checks if part of a range is part of another range without being totally contained in the other range. Hence Equal or ranges contained inside one another are not considered as overlapping.

      Parameters

      • otherRange: RangedSet<T>

        the other range to check if it overlaps with this range.

      Returns boolean

    • Prepends given range with this range. The last IP in the given range should be adjacent to the first IP in this range

      Parameters

      • otherRange: RangedSet<T>

        the other range to prepend

      Returns RangedSet<T>

    • Returns a sub range of a given size from this range.

      Parameters

      • offset: bigint

        offset from this range where the subrange should begin

      • size: bigint

        the size of the range

      Returns RangedSet<AbstractIPNum>

    • Converts to a string representation of the range in the form of: -

      Returns string