ip-num
    Preparing search index...

    Class Asn

    Represents an Autonomous System Number. Which is a number that is used to identify a group of IP addresses with a common, clearly defined routing policy.

    Hierarchy (View Summary)

    Index

    Constructors

    • Constructor for an instance of ASN

      Parameters

      • rawValue: string | number | bigint

        value to construct an ASN from. The given value can either be numeric or string. If in string then it can be in asplain, asdot or asdot+ string representation format

      Returns Asn

    Properties

    bitSize: number = 32

    The number of bits needed to represents the value of the ASN number

    maximumBitSize: bigint = Validator.THIRTY_TWO_BIT_SIZE

    The maximum bit size (i.e. binary value) of the ASN number in BigInt

    type: IPNumType = IPNumType.ASN
    value: bigint

    The decimal value represented by the ASN number in BigInt

    Methods

    • Gets the numeric value of an IP number as BigInt

      Returns bigint

      bigInt the numeric value of an IP number.

    • Checks if an IP number has a value greater than the present value

      Returns boolean

      true, if there is a value greater than the present value. Returns false otherwise.

    • Checks if an IP number has a value lesser than the present value

      Returns boolean

      true, if there is a value lesser than the present value. Returns false otherwise.

    • Checks if the ASN value is 16bit

      Returns boolean

      true if the ASN is a 16bit value. False otherwise.

    • Checks if the ASN value is 32bit

      Returns boolean

      true if the ASN is a 32bit value. False otherwise.

    • Checks if the given IP number is greater than this current IP number

      Parameters

      Returns boolean

      true if the given IP number is greater than this current one. False otherwise.

    • Checks if the given IP number is greater than or equals to this current IP number

      Parameters

      Returns boolean

      {boolean} true if the given IP number is greater than or equals to this current one. False otherwise.

    • Checks if the given IP number is lesser than this current IP number

      Parameters

      Returns boolean

      true if the given IP number is less than this current one. False otherwise.

    • Checks if the given IP number is less than or equals to this current IP number

      Parameters

      Returns boolean

      true if the given IP number is less than or equals to this current one. False otherwise.

    • A string representation where the ASN value is represented using the asplain notation if the ASN value is less than 65536 and uses asdot+ notation when the value is greater than 65536.

      For example 65526 will be represented as "65526" while 65546 will be represented as "1.10"

      Returns string

      A string representation of the ASN in either asplain or asdot+ notation depending on whether the numeric value of the ASN number is greater than 65526 or not.

    • A string representation where the ASN value is represented using the asdot+ notation

      Returns string

      A string representation where the ASN value is represented using the asdot+ notation

    • A string representation where the ASN numeric value of is represented as a string. For example "65526"

      Returns string

      A string representation where the ASN numeric value of is represented as a string

    • Converts the ASN value to binary numbers represented with strings

      Returns string

      a binary string representation of the value of the ASN number

    • A string representation where the asn value is prefixed by "ASN". For example "AS65526"

      Returns string

      A string representation where the asn value is prefixed by "ASN"

    • A convenience method for creating an instance of Asn from a binary string

      Parameters

      • binaryString: string

        to create an ASN instance from

      Returns Asn

      the constructed ASN instance

    • A convenience method for creating an instance of Asn from a numeric value

      Parameters

      • rawValue: number

        the asn numeric value

      Returns Asn

      the constructed ASN instance

    • A convenience method for creating an instance of Asn from a string

      The given string can be in asplain, asdot or asdot+ representation format. {@see https://tools.ietf.org/html/rfc5396} for more information on the different ASN string representation

      Parameters

      • rawValue: string

        the asn string. In either asplain, asdot or asdot+ format

      Returns Asn

      the constructed ASN instance