API reference › @evolu/common › Type › base64ToUint8Array

function base64ToUint8Array(value: string & Brand<"Base64">): Uint8Array;

Defined in: packages/common/src/Type.ts:8859

Converts Base64 to bytes.

Example

import { assertEqual, Base64, base64ToUint8Array } from "@evolu/common";

const value = Base64.orThrow("AAEC/w==");

assertEqual(base64ToUint8Array(value), new Uint8Array([0, 1, 2, 255]));