UNPKG

@hashgraph/sdk

Version:
25 lines (22 loc) 525 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.decode = decode; exports.encode = encode; var _jsBase = require("js-base64"); // SPDX-License-Identifier: Apache-2.0 /** * @param {string} text * @returns {Uint8Array} */ function decode(text) { return Uint8Array.from((0, _jsBase.atob)(text), c => c.charCodeAt(0)); } /** * @param {Uint8Array} data * @returns {string}; */ function encode(data) { return (0, _jsBase.btoa)(String.fromCharCode.apply(null, Array.from(data))); }