---
title: "Discussion on \"How might window.btoa() be implemented in JS?\" | Hashnode"
description: "Discussion on \"How might window.btoa() be implemented in JS?\". /**\n * @param {string} b\n * @returns {string}\n */\nconst btoa = (b) => {\n    let s = '';\n\n    const bytes = new Uint8Array(b.split('').map(x => x.charCodeAt(0)));\n    const ALPHABET_TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567..."
url: "https://hashnode.com/posts/how-might-windowbtoa-be-implemented-in-js/675c07afda78a552d7179cf1"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How might window.btoa() be implemented in JS?](https://blog.fuadolatunji.me/how-might-windowbtoa-be-implemented-in-js?utm_source=hashnode&utm_medium=feed)

/\*\* \* @param {string} b \* @returns {string} \*/ const btoa = (b) => { let s = ''; const bytes = new Uint8Array(b.split('').map(x => x.charCodeAt(0))); const ALPHABET\_TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567...

Dec 13, 2024 · 1 min read · blog.fuadolatunji.me  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Fuad Olatunji](https://hashnode.com/@fuadop)

@fuadop

  
[View profile](https://hashnode.com/@fuadop)

Technology Enthusiast

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
