(function (exports) { 'use strict'; // Used to provide the ability to associate some arbitrary and unformatted text // with a host or other name, such as a human readable information about a server // network, data center, and other accounting information. var unpackLabels = exports.DNS_UNPACK_LABELS || require('./dns.unpack-labels.js').DNS_UNPACK_LABELS; exports.DNS_TYPE_TXT = function (ab, packet, record) { var rdataAb = ab.slice(record.rdstart, record.rdstart + record.rdlength); console.log(rdataAb); var dv = new DataView(rdataAb); // var d = ''; // var string = ''; // for (var i = 0; i < dv.byteLength; i+= 1){ // d = dv.getUint8(i, false); // string = String.fromCharCode(d); // console.log("data at: " + i + " is: " + string); // record.data = [ unpackLabels(new Uint8Array(ab), record.rdstart, { byteLength: 0, cpcount: 0, labels: [], name: '' }).name ]; var l = unpackLabels(new Uint8Array(ab), record.rdstart, { byteLength: 0, cpcount: 0, labels: [], name: '' }); console.log("labels: " + JSON.stringify(l)); return record; }; }('undefined' !== typeof window ? window : exports));