Swap-Aggregator-Subgraph/node_modules/@ethersproject/base64/src.ts/base64.ts
2022-07-03 07:27:35 +05:30

13 lines
317 B
TypeScript

"use strict";
import { arrayify, BytesLike } from "@ethersproject/bytes";
export function decode(textData: string): Uint8Array {
return arrayify(new Uint8Array(Buffer.from(textData, "base64")));
};
export function encode(data: BytesLike): string {
return Buffer.from(arrayify(data)).toString("base64");
}