Re:Goodbye, Node.js Buffer
by ash_gti on Tuesday October 24, 2023 @10:28AM
(#37999640)
You can use ‘atob’ and ‘btoa’ functions for some of that.
[ Parent
| on HN ]
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.
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.