Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace ipv6

Index

Type aliases

Ipv6Literal: string | bigint

Type that indicates a literal string or number value that represents an IPv6 address

Ipv6Representable: Ipv6Address | Ipv6Literal

Type that indicates either a literal value or an address instance that is an IPv6

Variables

MAX: bigint = ...

The numerical maximum size an IPv6 address can be

Functions

  • Convenience function for creating an IPv6 address instance.

    remarks

    In general, you should use this function instead of instantiating an Ipv6Address object directly.

    example
    import { ipv6 as ip } from 'cidr-block'

    const localhost = ip.address('::1')
    see

    Ipv6Address

    Parameters

    • ip: Ipv6Literal

      string representation of the IPv6 address

    Returns Ipv6Address

    an instance of Ipv6Address

  • numToString(num: bigint): string
  • Converts the numerical representation of an IPv6 address to its string representation.

    see

    This method is the inverse of ipv6.stringToNum

    throws

    InvalidIpAddressError

    Parameters

    • num: bigint

    Returns string

    string representation of the address

  • stringToNum(address: string): bigint
  • Converts the string representation of an IPv6 address to a bigint.

    see

    Ipv6Address

    Parameters

    • address: string

    Returns bigint

    an instance of Ipv6Address

Generated using TypeDoc