ip-num
    Preparing search index...

    Class Validator

    Index

    Constructors

    Properties

    cannotSplitSingleRangeErrorMessage: string = "Cannot split an IP range with a single IP number"
    EIGHT_BIT_SIZE: bigint = ...
    invalid16BitAsnRangeMessage: string = "ASN number given less than zero or is greater than 16bit"
    invalidAsnRangeMessage: string = "ASN number given less than zero or is greater than 32bit"
    invalidBinaryStringErrorMessage: string = "Binary string should contain only contiguous 1s and 0s"
    invalidHexadecatetCountMessage: string = "An IP6 number must have exactly 8 hexadecatet"
    invalidHexadecatetMessage: string = "The value given is less than zero or is greater than 16bit"
    invalidInetNumType: string = "Given ipNumType must be either InetNumType.IPv4 or InetNumType.IPv6"
    InvalidIPCidrRangeMessage: string = "Given IP number portion must is not the start of the range"
    invalidIPRangeSizeForCidrMessage: string = "Given size can't be created via cidr prefix"
    invalidIPRangeSizeMessage: string = "Given size is zero or greater than maximum size of $iptype"
    invalidIPv4CidrNotationMessage: string = "Cidr notation should be in the form [ip number]/[range]"
    invalidIPv4NumberMessage: string = "IPv4 number given less than zero or is greater than 32bit"
    invalidIPv4PatternMessage: string = "Given IPv4 is not confirm to a valid IPv6 address"
    invalidIPv6CidrNotationString: string = "A Cidr notation string should contain an IPv6 number and prefix"
    invalidIPv6NumberMessage: string = "IPv6 number given less than zero or is greater than 128bit"
    invalidIPv6PatternMessage: string = "Given IPv6 is not confirm to a valid IPv6 address"
    invalidMaskMessage: string = "The Mask is invalid"
    invalidOctetCountMessage: string = "An IP4 number cannot have less or greater than 4 octets"
    invalidOctetRangeMessage: string = "Value given contains an invalid Octet; Value is less than zero or is greater than 8bit"
    invalidPrefixValueMessage: string = "A Prefix value cannot be less than 0 or greater than 32"
    invalidRangeFirstNotGreaterThanLastMessage: string = "First IP in [first ip]-[last ip] must be less than Last IP"
    invalidRangeNotationMessage: string = "Range notation should be in the form [first ip]-[last ip]"
    IPV4_CONTIGUOUS_MASK_BIT_PATTERN: RegExp = ...
    IPV4_PATTERN: RegExp = ...
    IPV4_RANGE_PATTERN: RegExp = ...
    IPV4_SIZE: bigint = ...
    IPV6_CONTIGUOUS_MASK_BIT_PATTERN: RegExp = ...
    IPV6_PATTERN: RegExp = ...
    IPV6_RANGE_PATTERN: RegExp = ...
    IPV6_SIZE: bigint = ...
    ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_SIZE: bigint = ...
    SIXTEEN_BIT_SIZE: bigint = ...
    takeOutOfRangeSizeMessage: string = "$count is greater than $size, the size of the range"
    THIRTY_TWO_BIT_SIZE: bigint = ...

    Methods

    • Checks if the given ASN number is a 16bit ASN number

      Parameters

      • asnNumber: bigint

        to check if 16bit or not

      Returns [boolean, string[]]

      first value is true if valid 16bit ASN, false otherwise. Second value contains "valid" or an error message when value is invalid

    • Checks if the number given is within the value considered valid for an ASN number

      Parameters

      • asnNumber: bigint

        the asn number to validate

      Returns [boolean, string[]]

      first value is true if valid ASN, false otherwise. Second value contains "valid" or an error message when value is invalid

    • Checks if the given string is a binary string. That is contains only contiguous 1s and 0s

      Parameters

      • binaryString: string

        the binary string

      Returns [boolean, string[]]

      a tuple representing if valid or not and corresponding message

    • Checks if the given string is a valid IPv4 range in Cidr notation

      Parameters

      • ipv4RangeAsCidrString: string

        the IPv4 range in Cidr notation

      Returns [boolean, string[]]

      first value is true if valid IPv4 range in Cidr notation, false otherwise. Second value contains "valid" or an error message when value is invalid

    • Checks if the given string is a valid IPv4 range in Cidr notation, with the ip number in the cidr notation being the start of the range

      Parameters

      • ipv4CidrNotation: string

        the IPv4 range in Cidr notation

      Returns [boolean, string[]]

      first value is true if valid Cidr notation, false otherwise. Second value contains [] or an array of error message when invalid

    • Checks if given string is a valid IPv4 mask

      Parameters

      • ipv4MaskString: string

        the given IPv4 mask string

      Returns [boolean, string[]]

      first value is true if valid IPv4 mask string, false otherwise. Second value contains "valid" or an error message when value is invalid

    • Checks if the number given is within the value considered valid for an IPv4 number

      Parameters

      • ipv4Number: number | bigint

        the asn number to validate

      Returns [boolean, string[]]

      first value is true if valid IPv4 number, false otherwise. Second value contains "valid" or an error message when value is invalid

    • Checks if the number given is valid for an IPv4 octet

      Parameters

      • octetNumber: bigint

        the octet value

      Returns [boolean, string[]]

      true if valid octet, false otherwise

    • Parameters

      • ipv4RangeString: string

      Returns [boolean, string[]]

    • Checks if given string is a valid IPv4 value.

      Parameters

      • ipv4String: string

        the IPv4 string to validate

      Returns [boolean, string[]]

      result of validation, first value represents if is valid IPv4, second value contains error message if invalid IPv4

    • Checks if the given string is a valid IPv6 range in Cidr notation

      Parameters

      • ipv6RangeAsCidrString: string

        the IPv6 range in Cidr notation

      Returns [boolean, string[]]

      first value is true if valid IPv6 range in Cidr notation, false otherwise. Second value contains "valid" or an error message when value is invalid

    • Checks if the given string is a valid IPv6 range in Cidr notation, with the ip number in the cidr notation being the start of the range

      Parameters

      • ipv6CidrNotation: string

        the IPv6 range in Cidr notation

      Returns [boolean, string[]]

      first value is true if valid Cidr notation, false otherwise. Second value contains [] or an array of error message when invalid

    • Checks if the number given is valid for an IPv6 hexadecatet

      Parameters

      • hexadecatetNum: bigint

        the hexadecatet value

      Returns [boolean, string[]]

      first value is true if valid hexadecatet, false otherwise. Second value contains "valid" or an error message when value is invalid

    • Checks if given string is a valid IPv6 mask

      Parameters

      • ipv6MaskString: string

        the given IPv6 mask string

      Returns [boolean, string[]]

      first value is true if valid IPv6 mask string, false otherwise. Second value contains "valid" or an error message when value is invalid

    • Checks if the number given is within the value considered valid for an IPv6 number

      Parameters

      • ipv6Number: bigint

        the asn number to validate

      Returns [boolean, string[]]

      first value is true if valid IPv6 number, false otherwise. Second value contains "valid" or an error message when value is invalid

    • Parameters

      • ipv6RangeString: string

      Returns [boolean, string[]]

    • Checks if given string is a valid IPv6 value.

      Parameters

      • ipv6String: string

        the IPv6 string to validate

      Returns [boolean, string[]]

      result of validation, first value represents if is valid IPv6, second value contains error message if invalid IPv6

    • Checks if given value is a valid prefix value

      Parameters

      • prefixValue: bigint

        value to check

      • ipNumType: IPNumType

        The type of IP number

      Returns [boolean, string[]]

      a tuple representing if valid or not and corresponding message