MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / pktLine

Function pktLine

e2e/scenarios/custom-tools.test.ts:28–32  ·  view source on GitHub ↗
(payload: string | Uint8Array)

Source from the content-addressed store, hash-verified

26};
27
28const pktLine = (payload: string | Uint8Array): Uint8Array => {
29 const body = typeof payload === "string" ? textEncoder.encode(payload) : payload;
30 const header = textEncoder.encode((body.length + 4).toString(16).padStart(4, "0"));
31 return concat([header, body]);
32};
33
34const FLUSH = textEncoder.encode("0000");
35

Callers 2

sideBandFunction · 0.70
advertisementFunction · 0.70

Calls 2

toStringMethod · 0.80
concatFunction · 0.70

Tested by

no test coverage detected