MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / encodeStr

Function encodeStr

runtime/src/rt.js:67–74  ·  view source on GitHub ↗
(exps, s)

Source from the content-addressed store, hash-verified

65};
66
67function encodeStr(exps, s) {
68 const bytes = TE.encode(s);
69 const ptr = exps.wasm_alloc(bytes.length);
70 new Uint8Array(exps.memory.buffer, ptr, bytes.length).set(bytes);
71 const h = exps.host_edge_encode(TAG_BYTES, ptr, bytes.length);
72 exps.wasm_free(ptr, bytes.length);
73 return h;
74}
75function encodeInt(exps, n) {
76 const buf = exps.wasm_alloc(16);
77 const view = new DataView(exps.memory.buffer);

Callers 2

makeRtFunction · 0.85
encodeAnyFunction · 0.85

Calls 1

setMethod · 0.80

Tested by

no test coverage detected