anza-xyz / anza-xyz/kit

Rewrite base64 + base16 codecs using native APIs

Open
#1,150 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
695
Forks
210
Avg merge
21h 33m
Merged PRs (30d)
90

Description

TIL, the web platform has built in conversion between base64/hex strings and Uint8array

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromBase64
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toBase64
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromHex
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toHex

All are in Baseline 2025, ie available in the latest version of all browsers

Should make our base64 + base16 codecs much simpler + probably more performant

- We may want to wait until Node 26 releases, since it is only in 25 and that will be the next LTS
- Will need to use `EsNext.TypedArrays` lib in typescript 6.0 https://github.com/microsoft/TypeScript/pull/61696/files

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.