ethers.js/utils/base64.js

13 lines
362 B
JavaScript
Raw Normal View History

2018-06-13 22:39:39 +03:00
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
2018-06-17 23:47:28 +03:00
var bytes_1 = require("./bytes");
2018-06-13 22:39:39 +03:00
function decode(textData) {
2018-06-17 23:47:28 +03:00
return bytes_1.arrayify(new Uint8Array(new Buffer(textData, 'base64')));
2018-06-13 22:39:39 +03:00
}
exports.decode = decode;
;
function encode(data) {
2018-06-17 23:47:28 +03:00
return new Buffer(bytes_1.arrayify(data)).toString('base64');
2018-06-13 22:39:39 +03:00
}
exports.encode = encode;