dns-suite.js/packer/type.txt.js

39 lines
904 B
JavaScript
Raw Normal View History

2017-03-10 02:34:27 +00:00
(function (exports) {
'use strict';
// Record type is just any text.
exports.DNS_PACKER_TYPE_TXT = function (ab, dv, total, record) {
// if (!record.data){
// throw new Error("no data for TXT record");
// }
// console.log("record data is: " + record.data);
// var txtLen = 0;
// var rdLenIndex = total;
// total += 2;
// //RDATA
// // a sequence of labels
// record.data.split('.').forEach(function (label) {
// txtLen += 1 + label.length;
// dv.setUint8(total, label.length, false);
// total += 1;
// label.split('').forEach(function (ch) {
// dv.setUint8(total, ch.charCodeAt(0), false);
// total += 1;
// });
// });
// // RDLENGTH
// dv.setUint16(rdLenIndex, record.data.length + 1, false);
// return total;
};
}('undefined' !== typeof window ? window : exports));