Hacker News new | ask | show | jobs
by ash_gti 963 days ago
You can use ‘atob’ and ‘btoa’ functions for some of that.
2 comments

Those functions are fundamentally broken: https://developer.mozilla.org/en-US/docs/Glossary/Base64#jav...

See the whole section on converting arbitrary binary data and the complex ways to do it.

Although those functions operate on "binary strings", not Uint8Arrays, and there is no especially clean way that vanilla JS exposes to convert between the two that I am aware of.