diff options
Diffstat (limited to 'docs/guides/util')
-rw-r--r-- | docs/guides/util/base64.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/guides/util/base64.md b/docs/guides/util/base64.md new file mode 100644 index 000000000..06003f062 --- /dev/null +++ b/docs/guides/util/base64.md @@ -0,0 +1,15 @@ +--- +name: Encode and decode base64 strings +--- + +Bun implements the Web-standard [`atob`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/atob) and [`btoa`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/btoa) functions for encoding and decoding base64 strings. + +```ts +const data = "hello world"; +const encoded = btoa(data); // => "aGVsbG8gd29ybGQ=" +const decoded = atob(encoded); // => "hello world" +``` + +--- + +See [Docs > API > Hashing](/docs/api/hashing#bun-password) for complete documentation. |