3e5731a7b8
* add auto-import * remove imports that we can and get rid of autosize shim * remove items from eslinrc * import base64js in shamir key
12 lines
334 B
JavaScript
12 lines
334 B
JavaScript
import base64js from 'base64-js';
|
|
|
|
export function encodeString(string) {
|
|
var encoded = new TextEncoderLite('utf-8').encode(string);
|
|
return base64js.fromByteArray(encoded);
|
|
}
|
|
|
|
export function decodeString(b64String) {
|
|
var uint8array = base64js.toByteArray(b64String);
|
|
return new TextDecoderLite('utf-8').decode(uint8array);
|
|
}
|