3 ms·
I've just stumpled once again on atob/btoa not working with characters like or 𝒞 and here I read about SharedArrayBuffers, which is way a greater goal. Of cou
by riquito 10y ago
I've just stumpled once again on atob/btoa not working with characters like or 𝒞 and here I read about SharedArrayBuffers, which is way a greater goal. Of course they're right to work on such projects, go for it, but I can't avoid to be baffled by the fact that (apparently) more mundane operations don't receive love.
Other examples would be MD5 removed from subtlecrypto, killing any way to speak with services that use it for non-cryptographic operations, or the missing functions to encode/decode hex strings, which maybe are not everyday use cases but are provided by most languages and would need an afternoon to write with tests.
I want a better standard library.
Just my discouraged 5 cents.
- ygra 10y agoatob/btoa is atrocious from an API design standpoint. Here we are, designing an API to convert things to Base64 and back and we use a string as a byte array substitute, nevermind the fact that strings are not limited to Latin-1. There's probably a bunch of libraries that solve this, but stumbling over this in a library that has no outside dependencies is a bit annoying since you have to solve it yourself ... again.
- IIIIIIIIIIII 10y agoI'm just curious since I never used this feature, are you talking about this issue? > The "Unicode Problem" > Since DOMStrings are 16-bit-encoded strings, in most browsers calling window.btoa on a Unicode string will cause a Character Out Of Range exception if a character exceeds the range of a 8-bit ASCII-encoded character. There are two possible methods to solve this problem: https://developer.mozilla.org/en/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_.22Unicode_Problem.22 https://developer.mozilla.org/en/docs/Web/API/WindowBase64/B...
- riquito 10y agoYes, that one