@cloudcome/utils-browser
Version:
cloudcome utils for browser
15 lines (14 loc) • 549 B
TypeScript
/**
* 【浏览器环境】将字符串编码为 Base64 格式
* @param input 要编码的字符串
* @returns 编码后的 Base64 字符串
* @remarks
* 在 Node.js 环境中使用 Buffer 实现,在浏览器环境中使用 TextEncoder 和 btoa 实现
*/
export declare function encodeBase64(input: string): string;
/**
* 【浏览器环境】 将 Base64 字符串解码为原始字符串
* @param input 要解码的 Base64 字符串
* @returns 解码后的原始字符串
*/
export declare function decodeBase64(input: string): string;