MCPcopy
hub / github.com/di-sukharev/opencommit / decode

Method decode

out/cli.cjs:25742–25757  ·  view source on GitHub ↗

* @param {Uint32Array} tokens * @returns {Uint8Array}

(tokens)

Source from the content-addressed store, hash-verified

25740 * @returns {Uint8Array}
25741 */
25742 decode(tokens) {
25743 if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
25744 try {
25745 const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
25746 const ptr0 = passArray32ToWasm0(tokens, wasm.__wbindgen_export_0);
25747 const len0 = WASM_VECTOR_LEN;
25748 wasm.tiktoken_decode(retptr, this.__wbg_ptr, ptr0, len0);
25749 var r0 = getInt32Memory0()[retptr / 4 + 0];
25750 var r1 = getInt32Memory0()[retptr / 4 + 1];
25751 var v22 = getArrayU8FromWasm0(r0, r1).slice();
25752 wasm.__wbindgen_export_2(r0, r1 * 1, 1);
25753 return v22;
25754 } finally {
25755 wasm.__wbindgen_add_to_stack_pointer(16);
25756 }
25757 }
25758 /**
25759 * @param {number} token
25760 * @returns {Uint8Array}

Callers 15

isBidiDomainFunction · 0.45
processingFunction · 0.45
utf8DecodeWithoutBOMFunction · 0.45
textMethod · 0.45
getStringFromWasm0Function · 0.45
stringFromBytesFunction · 0.45
parseEventFunction · 0.45
formDataFunction · 0.45
utf8DecodeBytesFunction · 0.45
decodeFunction · 0.45

Calls 9

passArray32ToWasm0Function · 0.85
getInt32Memory0Function · 0.85
getArrayU8FromWasm0Function · 0.85
partitionFunction · 0.85
partition2Function · 0.85
endsWithMethod · 0.80
startsWithMethod · 0.80
sliceMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected