dns-packet
Advanced tools
Comparing version 1.3.3 to 1.3.4
32
index.js
@@ -17,3 +17,3 @@ var types = require('./types') | ||
name.encode = function (str, buf, offset) { | ||
if (!buf) buf = Buffer.allocUnsafe(name.encodingLength(str)) | ||
if (!buf) buf = Buffer.alloc(name.encodingLength(str)) | ||
if (!offset) offset = 0 | ||
@@ -85,3 +85,3 @@ var oldOffset = offset | ||
string.encode = function (s, buf, offset) { | ||
if (!buf) buf = Buffer.allocUnsafe(string.encodingLength(s)) | ||
if (!buf) buf = Buffer.alloc(string.encodingLength(s)) | ||
if (!offset) offset = 0 | ||
@@ -168,3 +168,3 @@ | ||
runknown.encode = function (data, buf, offset) { | ||
if (!buf) buf = Buffer.allocUnsafe(runknown.encodingLength(data)) | ||
if (!buf) buf = Buffer.alloc(runknown.encodingLength(data)) | ||
if (!offset) offset = 0 | ||
@@ -199,3 +199,3 @@ | ||
rns.encode = function (data, buf, offset) { | ||
if (!buf) buf = Buffer.allocUnsafe(rns.encodingLength(data)) | ||
if (!buf) buf = Buffer.alloc(rns.encodingLength(data)) | ||
if (!offset) offset = 0 | ||
@@ -230,3 +230,3 @@ | ||
rsoa.encode = function (data, buf, offset) { | ||
if (!buf) buf = Buffer.allocUnsafe(rsoa.encodingLength(data)) | ||
if (!buf) buf = Buffer.alloc(rsoa.encodingLength(data)) | ||
if (!offset) offset = 0 | ||
@@ -294,7 +294,7 @@ | ||
rtxt.encode = function (data, buf, offset) { | ||
if (!buf) buf = Buffer.allocUnsafe(rtxt.encodingLength(data)) | ||
if (!buf) buf = Buffer.alloc(rtxt.encodingLength(data)) | ||
if (!offset) offset = 0 | ||
if (typeof data === 'string') data = Buffer.from(data) | ||
if (!data) data = Buffer.allocUnsafe(0) | ||
if (!data) data = Buffer.alloc(0) | ||
@@ -339,3 +339,3 @@ var oldOffset = offset | ||
rhinfo.encode = function (data, buf, offset) { | ||
if (!buf) buf = Buffer.allocUnsafe(rhinfo.encodingLength(data)) | ||
if (!buf) buf = Buffer.alloc(rhinfo.encodingLength(data)) | ||
if (!offset) offset = 0 | ||
@@ -382,3 +382,3 @@ | ||
rptr.encode = function (data, buf, offset) { | ||
if (!buf) buf = Buffer.allocUnsafe(rptr.encodingLength(data)) | ||
if (!buf) buf = Buffer.alloc(rptr.encodingLength(data)) | ||
if (!offset) offset = 0 | ||
@@ -411,3 +411,3 @@ | ||
rsrv.encode = function (data, buf, offset) { | ||
if (!buf) buf = Buffer.allocUnsafe(rsrv.encodingLength(data)) | ||
if (!buf) buf = Buffer.alloc(rsrv.encodingLength(data)) | ||
if (!offset) offset = 0 | ||
@@ -457,3 +457,3 @@ | ||
if (!buf) buf = Buffer.allocUnsafe(rcaa.encodingLength(data)) | ||
if (!buf) buf = Buffer.alloc(rcaa.encodingLength(data)) | ||
if (!offset) offset = 0 | ||
@@ -510,3 +510,3 @@ | ||
ra.encode = function (host, buf, offset) { | ||
if (!buf) buf = Buffer.allocUnsafe(ra.encodingLength(host)) | ||
if (!buf) buf = Buffer.alloc(ra.encodingLength(host)) | ||
if (!offset) offset = 0 | ||
@@ -541,3 +541,3 @@ | ||
raaaa.encode = function (host, buf, offset) { | ||
if (!buf) buf = Buffer.allocUnsafe(raaaa.encodingLength(host)) | ||
if (!buf) buf = Buffer.alloc(raaaa.encodingLength(host)) | ||
if (!offset) offset = 0 | ||
@@ -590,3 +590,3 @@ | ||
answer.encode = function (a, buf, offset) { | ||
if (!buf) buf = Buffer.allocUnsafe(answer.encodingLength(a)) | ||
if (!buf) buf = Buffer.alloc(answer.encodingLength(a)) | ||
if (!offset) offset = 0 | ||
@@ -649,3 +649,3 @@ | ||
question.encode = function (q, buf, offset) { | ||
if (!buf) buf = Buffer.allocUnsafe(question.encodingLength(q)) | ||
if (!buf) buf = Buffer.alloc(question.encodingLength(q)) | ||
if (!offset) offset = 0 | ||
@@ -707,3 +707,3 @@ | ||
var allocing = !buf | ||
if (allocing) buf = Buffer.allocUnsafe(exports.encodingLength(result)) | ||
if (allocing) buf = Buffer.alloc(exports.encodingLength(result)) | ||
if (!offset) offset = 0 | ||
@@ -710,0 +710,0 @@ |
{ | ||
"name": "dns-packet", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"description": "An abstract-encoding compliant module for encoding / decoding DNS packets", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28328