Closed sebilasse closed 7 years ago
I ended up doing a unintentional fix for this in dojo/web-editor#7 which I should port over to here to fix the issue.
Taking a look at this, the API don't do what you might think it does. It really is designed for encoding an already base64 encoded string into a structured array, which can be handled in other ways. I think its general utility as part of core isn't actually that critical. I think it was more useful for our streams and encryption packages, which we haven't yet found a compelling need to migrate those to a beta stage. (Though neither package actually uses these).
We might want consider removing this from core until there is a compelling use case for it. One is alluding me at the moment. Also the utility that @sebilasse is essentially what I needed in web-editor
. I will introduce that instead.
I am not sure about base64 but it returns different results compared to my own base64 functions ... However even directly decoding an encoded string returns a wrong result : A very simple test was console.log( base64.decode(base64.encode('Lorem')) );
Should result: 'Lorem' This results in 'Lore' ...
Apart from that if I've got characters like
+
it was a completely different result.What I am basically looking for are the functions to encode/decode any string to base64 and to base64Url. This is what I am currently using: