2019-05-15 01:48:48 +03:00
|
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
2021-03-08 02:24:04 +03:00
|
|
|
exports.encode = exports.decode = void 0;
|
2019-05-15 01:48:48 +03:00
|
|
|
var bytes_1 = require("@ethersproject/bytes");
|
|
|
|
function decode(textData) {
|
|
|
|
textData = atob(textData);
|
|
|
|
var data = [];
|
|
|
|
for (var i = 0; i < textData.length; i++) {
|
|
|
|
data.push(textData.charCodeAt(i));
|
|
|
|
}
|
2021-10-16 09:29:27 +03:00
|
|
|
return (0, bytes_1.arrayify)(data);
|
2019-05-15 01:48:48 +03:00
|
|
|
}
|
|
|
|
exports.decode = decode;
|
|
|
|
function encode(data) {
|
2021-10-16 09:29:27 +03:00
|
|
|
data = (0, bytes_1.arrayify)(data);
|
2019-05-15 01:48:48 +03:00
|
|
|
var textData = "";
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
textData += String.fromCharCode(data[i]);
|
|
|
|
}
|
|
|
|
return btoa(textData);
|
|
|
|
}
|
|
|
|
exports.encode = encode;
|
2020-11-17 07:07:24 +03:00
|
|
|
//# sourceMappingURL=browser-base64.js.map
|