Function hextoipv6

  • convert a 16 byte hexadecimal string to RFC 5952 canonicalized IPv6 address

    Parameters

    • hex: string

      hexadecimal string of 16 byte IPv6 address

    Returns string

    IPv6 address string canonicalized by RFC 5952

    Description

    This function converts a 16 byte hexadecimal string to RFC 5952 canonicalized IPv6 address string.

    Example

    hextoipv6("871020010db8000000000000000000000004") -> "2001:db8::4"
    hextoipv6("871020010db8000000000000000000") -> raise exception
    hextoipv6("xyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyz") -> raise exception