cidr-block - v2.1.1
    Preparing search index...

    Function parseHextets

    • Parses the given IPv6 address into its hextets representation.

      Parameters

      • ip: Ipv6AddressLiteral

        The IPv6 address to parse, which can be in string, bigint, or hextets array format.

      Returns Ipv6AddressHextets

      An array of eight numbers representing the hextets of the IPv6 address.

      import { ipv6 } from 'cidr-block';

      ipv6.parseHextets("2001:db8::1"); // [0x2001, 0xdb8, 0, 0, 0, 0, 0, 1]
      ipv6.parseHextets("::"); // [0, 0, 0, 0, 0, 0, 0, 0]
      ipv6.parseHextets(42540766411282592856903984951653826561n); // [0x2001, 0xdb8, 0, 0, 0, 0, 0, 1]

      If the input is not a valid IPv6 address.