mirror of
https://github.com/status-im/consul.git
synced 2025-01-17 09:11:28 +00:00
61d7acd51f
* 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
7 lines
166 B
JavaScript
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);
|
|
}
|