boolToBytes

Converts a boolean value to a Uint8Array of bytes.

Example

import { boolToBytes } from "thirdweb/utils";
const bytes = boolToBytes(true);
console.log(bytes); // Uint8Array(1) [ 1 ]
function boolToBytes(
value: boolean,
): Uint8Array;

Parameters

The boolean value to convert.

Type

let value: boolean;

Optional parameters for the conversion.

Type

let opts: { size?: number };

Returns

let returnType: Uint8Array;

The Uint8Array of bytes representing the boolean value.