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,
opts: Options,
): Uint8Array<ArrayBufferLike>;

Parameters

The boolean value to convert.

Type

let value: boolean;

Optional parameters for the conversion.

Type

let opts: Options;

Returns

let returnType: Uint8Array<ArrayBufferLike>;

The Uint8Array of bytes representing the boolean value.