@basmilius/apple-encoding 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -110,7 +110,7 @@ function encodeTag(tag, value) {
|
|
|
110
110
|
} else {
|
|
111
111
|
valueBuffer = value;
|
|
112
112
|
}
|
|
113
|
-
const lengthBuffer = Buffer.
|
|
113
|
+
const lengthBuffer = Buffer.allocUnsafe(4);
|
|
114
114
|
lengthBuffer.writeUInt32BE(valueBuffer.length, 0);
|
|
115
115
|
return Buffer.concat([tagBuffer, lengthBuffer, valueBuffer]);
|
|
116
116
|
}
|
|
@@ -330,7 +330,7 @@ function decode2(buffer) {
|
|
|
330
330
|
};
|
|
331
331
|
}
|
|
332
332
|
function encode(fields) {
|
|
333
|
-
const buffer = Buffer.
|
|
333
|
+
const buffer = Buffer.allocUnsafe(32);
|
|
334
334
|
buffer.writeUInt8(fields.proto, 0);
|
|
335
335
|
buffer.writeUInt8(fields.type, 1);
|
|
336
336
|
buffer.writeUInt16BE(fields.seqno, 2);
|