@hiero-ledger/cryptography
Version:
Cryptographic utilities and primitives for the Hiero SDK
18 lines (15 loc) • 322 B
JavaScript
import { Buffer } from "buffer";
/**
* @param {string} text
* @returns {Uint8Array}
*/
export function decode(text) {
return Uint8Array.from(Buffer.from(text, "base64"));
}
/**
* @param {Uint8Array} data
* @returns {string};
*/
export function encode(data) {
return Buffer.from(data).toString("base64");
}