Closed acutmore closed 4 years ago
Thanks for checking out the project!
I originally used atob
and btoa
with this and another project,1 but for both projects quickly ran into the "Unicode Problem" with those functions.2 In this case, since I am directly encoding bytes from the SubtleCrypto
API, rather than Unicode code points, none of the solutions I could find apply. The only existing solutions that I could find involved using external base-64 libraries for encoding arbitrary bytes. In this case, I just decided to write my own base-64 library instead of pulling in an external one.
Thanks again for taking the time to look at the code!
1 https://github.com/jstrieb/urlpages
2 See this StackOverflow post
Today I learn about the "Unicode Problem" with atob, thank you!
Today I learn about the "Unicode Problem" with atob, thank you!
Hopefully knowing this is helpful. It took me way too long to figure out because I never suspected that the built-in functions would be the problem! Thanks again for your suggestion!
Cool concept!
One idea, if you hadn't already considered, is to use the built-in
atob
function instead of loading a custom base-64 library.