You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
We had two identical sets of base64 functions in the js-sdk, both using Buffer which isn't really available in the browser unless you're using an old webpack (ie. what element-web uses). This PR: * Takes the crypto base64 file and moves it out of crypto (because we use base64 for much more than just crypto) * Makes them work in a browser without the Buffer global * Removes the other base64 functions * Changes everything to use the new common ones * Adds a comment explaining why the function is kinda ugly and how soul destroyingly awful the JS ecosystem is. * Runs the tests with both impls * Changes the test to not just test the decoder against the encoder * Adds explicit support & tests for (decoding) base64Url (I'll add an encode method later, no need for that to go in this PR too).
4.4 KiB
4.4 KiB