John Cowen 61d7acd51f
ui: Tweak some code related meta information (#12117)
* ui: Correct some meta info

* Encoder doesn't take an argument whereas decoder does

* Math.trunc looks like the closest to parseInt but using the correct type

*  use a dynamic string when setting things on window
2022-01-21 11:42:48 +00:00

7 lines
166 B
JavaScript

import base64js from 'base64-js';
export default function(str) {
// encode
const bytes = new TextEncoder().encode(str);
return base64js.fromByteArray(bytes);
}