MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / decode_single_token_bytes

Method decode_single_token_bytes

out/cli.cjs:25762–25775  ·  view source on GitHub ↗

* @param {number} token * @returns {Uint8Array}

(token)

Source from the content-addressed store, hash-verified

25760 * @returns {Uint8Array}
25761 */
25762 decode_single_token_bytes(token) {
25763 if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
25764 try {
25765 const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
25766 wasm.tiktoken_decode_single_token_bytes(retptr, this.__wbg_ptr, token);
25767 var r0 = getInt32Memory0()[retptr / 4 + 0];
25768 var r1 = getInt32Memory0()[retptr / 4 + 1];
25769 var v1 = getArrayU8FromWasm0(r0, r1).slice();
25770 wasm.__wbindgen_export_2(r0, r1 * 1, 1);
25771 return v1;
25772 } finally {
25773 wasm.__wbindgen_add_to_stack_pointer(16);
25774 }
25775 }
25776 /** @returns {any} */
25777 token_byte_values() {
25778 if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");

Callers

nothing calls this directly

Calls 3

getInt32Memory0Function · 0.85
getArrayU8FromWasm0Function · 0.85
sliceMethod · 0.45

Tested by

no test coverage detected