(encodedInt: Uint8Array, maxLength: number = Infinity)
| 34 | } |
| 35 | |
| 36 | export 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 | |
| 47 | export function encodeString(str: string): Uint8Array { |
| 48 | return utf8ToBin(str); |
no outgoing calls
no test coverage detected