Encode a UTF-8 string to bytes. Uses the global TextEncoder.
TextEncoder
import { toBytes } from "@aspect/crypto-edge";const bytes = toBytes("hello world");// Uint8Array of UTF-8 encoded bytes Copy
import { toBytes } from "@aspect/crypto-edge";const bytes = toBytes("hello world");// Uint8Array of UTF-8 encoded bytes
Encode a UTF-8 string to bytes. Uses the global
TextEncoder.