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

Function encodeBool

packages/utils/src/data.ts:10–12  ·  view source on GitHub ↗
(bool: boolean)

Source from the content-addressed store, hash-verified

8} from '@bitauth/libauth';
9
10export function encodeBool(bool: boolean): Uint8Array {
11 return bool ? encodeInt(1n) : encodeInt(0n);
12}
13
14export function decodeBool(encodedBool: Uint8Array): boolean {
15 // Any encoding of 0 is false, else true

Callers 4

encodeFunctionArgumentFunction · 0.90
visitMultiSigMethod · 0.90
visitBoolLiteralMethod · 0.90
data.test.tsFile · 0.85

Calls 1

encodeIntFunction · 0.85

Tested by

no test coverage detected