Converts a string to an array of bytes.
import { stringToBytes } from "thirdweb/utils";const bytes = stringToBytes("Hello, world!");console.log(bytes); // Uint8Array(13) [ 72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33 ]
function stringToBytes( value: string, opts: StringToBytesOpts,): Uint8Array;
The string to convert.
let value: string;
Optional parameters for the conversion.
let opts: { size?: number };
let returnType: Uint8Array;
The array of bytes representing the string.