@creit.tech/stellar-wallets-kit
Version:
A kit to handle all Stellar Wallets at once
40 lines • 1.1 kB
TypeScript
import type { Uint8Array_ } from "./_types.js";
export type { Uint8Array_ };
/**
* Converts data into a base64-encoded string.
*
* @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
*
* @param data The data to encode.
* @returns The base64-encoded string.
*
* @example Usage
* ```ts
* import { encodeBase64 } from "@std/encoding/base64";
* import { assertEquals } from "@std/assert";
*
* assertEquals(encodeBase64("foobar"), "Zm9vYmFy");
* ```
*/
export declare function encodeBase64(data: ArrayBuffer | Uint8Array | string): string;
/**
* Decodes a base64-encoded string.
*
* @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
*
* @param b64 The base64-encoded string to decode.
* @returns The decoded data.
*
* @example Usage
* ```ts
* import { decodeBase64 } from "@std/encoding/base64";
* import { assertEquals } from "@std/assert";
*
* assertEquals(
* decodeBase64("Zm9vYmFy"),
* new TextEncoder().encode("foobar")
* );
* ```
*/
export declare function decodeBase64(b64: string): Uint8Array_;
//# sourceMappingURL=base64.d.ts.map