edgeport - v1.0.6
    Preparing search index...

    Function encodeName

    • Encodes a domain name as a sequence of length-prefixed labels ending in the zero label.

      Names are encoded uncompressed (never using pointers), which is always valid on the wire. A trailing dot is accepted and ignored; the root ("" or ".") encodes to a single zero byte.

      Parameters

      • name: string

        The dot-separated domain name.

      Returns Uint8Array

      The encoded name bytes.

      If a label exceeds 63 octets or the whole name exceeds 255 octets.

      1.0.4

      import { encodeName } from 'edgeport/dns';

      encodeName('example.com'); // 07 'example' 03 'com' 00