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

Method encode_ordinary

out/cli.cjs:25687–25702  ·  view source on GitHub ↗

* @param {string} text * @returns {Uint32Array}

(text)

Source from the content-addressed store, hash-verified

25685 * @returns {Uint32Array}
25686 */
25687 encode_ordinary(text) {
25688 if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
25689 try {
25690 const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
25691 const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
25692 const len0 = WASM_VECTOR_LEN;
25693 wasm.tiktoken_encode_ordinary(retptr, this.__wbg_ptr, ptr0, len0);
25694 var r0 = getInt32Memory0()[retptr / 4 + 0];
25695 var r1 = getInt32Memory0()[retptr / 4 + 1];
25696 var v22 = getArrayU32FromWasm0(r0, r1).slice();
25697 wasm.__wbindgen_export_2(r0, r1 * 4, 4);
25698 return v22;
25699 } finally {
25700 wasm.__wbindgen_add_to_stack_pointer(16);
25701 }
25702 }
25703 /**
25704 * @param {string} text
25705 * @param {any} allowed_special

Callers

nothing calls this directly

Calls 4

passStringToWasm0Function · 0.85
getInt32Memory0Function · 0.85
getArrayU32FromWasm0Function · 0.85
sliceMethod · 0.45

Tested by

no test coverage detected