Portable WASM strings are byte ranges in linear memory. JavaScript usually encodes strings with `TextEncoder`, passes pointer and length to WASM, then decodes result bytes with `TextDecoder`.

Base64 scaffold
function b_64decode(data: string, altchars = '+/'): Uint8Array {
  const normalized = data.replaceAll(altchars[0] ?? '+', '+').replaceAll(altchars[1] ?? '/', '/');
  return Uint8Array.from(atob(normalized), (char) => char.charCodeAt(0));
}