Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/sites/node_modules/@aws-sdk/eventstream-marshaller/dist-es/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import { Crc32 } from "@aws-crypto/crc32";
import { HeaderMarshaller } from "./HeaderMarshaller";
import { splitMessage } from "./splitMessage";
var EventStreamMarshaller = (function () {
function EventStreamMarshaller(toUtf8, fromUtf8) {
this.headerMarshaller = new HeaderMarshaller(toUtf8, fromUtf8);
}
EventStreamMarshaller.prototype.marshall = function (_a) {
var rawHeaders = _a.headers, body = _a.body;
var headers = this.headerMarshaller.format(rawHeaders);
var length = headers.byteLength + body.byteLength + 16;
var out = new Uint8Array(length);
var view = new DataView(out.buffer, out.byteOffset, out.byteLength);
var checksum = new Crc32();
view.setUint32(0, length, false);
view.setUint32(4, headers.byteLength, false);
view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false);
out.set(headers, 12);
out.set(body, headers.byteLength + 12);
view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false);
return out;
};
EventStreamMarshaller.prototype.unmarshall = function (message) {
var _a = splitMessage(message), headers = _a.headers, body = _a.body;
return { headers: this.headerMarshaller.parse(headers), body: body };
};
EventStreamMarshaller.prototype.formatHeaders = function (rawHeaders) {
return this.headerMarshaller.format(rawHeaders);
};
return EventStreamMarshaller;
}());
export { EventStreamMarshaller };
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0049 ]-- |