This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the web-development category.
Last Updated: 2024-12-03
Some quick notes on dealing with binary data on the web:
btoa
)/ decode (atob
) unicode (often ASCII) input as base64btoa
is in HTML standard (it is in most browsers but not in React Native) The input data must be in the form of a string containing only characters in the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF.btoa
stands for "binary to ascii" and atob
is ascii to binary. THe In practice both the input and output of these functions are Unicode strings. What differs is whether one outputs base64 or note - this being considered ascii.