ethers.js/packages/base64/lib/index.js

13 lines
377 B
JavaScript
Raw Normal View History

2019-05-15 01:48:48 +03:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var bytes_1 = require("@ethersproject/bytes");
function decode(textData) {
return bytes_1.arrayify(new Uint8Array(Buffer.from(textData, "base64")));
}
exports.decode = decode;
;
function encode(data) {
return Buffer.from(bytes_1.arrayify(data)).toString("base64");
}
exports.encode = encode;