edgeport - v1.0.6
    Preparing search index...

    Function encodeRdata

    • Encodes the structured resource data of a record TYPE into its wire rdata (uncompressed names).

      Supports the same TYPEs parseRdata decodes; for any other TYPE, pass the raw rdata as a Uint8Array and it is returned unchanged. Used by record and by tests building responses.

      Parameters

      • type: number

        The record TYPE.

      • data: RData

        The structured data for a known TYPE, or raw rdata bytes.

      Returns Uint8Array

      The encoded rdata octets.

      If a known TYPE is given data of the wrong shape.

      1.0.4

      import { encodeRdata, RecordType } from 'edgeport/dns';

      encodeRdata(RecordType.A, '93.184.216.34'); // Uint8Array [93, 184, 216, 34]