MCPcopy Create free account
hub / github.com/CashScript/cashscript / decodeInt

Function decodeInt

packages/utils/src/data.ts:36–45  ·  view source on GitHub ↗
(encodedInt: Uint8Array, maxLength: number = Infinity)

Source from the content-addressed store, hash-verified

34}
35
36export function decodeInt(encodedInt: Uint8Array, maxLength: number = Infinity): bigint {
37 const options = { maximumVmNumberByteLength: maxLength };
38 const result = vmNumberToBigInt(encodedInt, options);
39
40 if (isVmNumberError(result)) {
41 throw new Error(result);
42 }
43
44 return result;
45}
46
47export function encodeString(str: string): Uint8Array {
48 return utf8ToBin(str);

Callers 2

decodeStackItemFunction · 0.90
data.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected