@ivujs/i-utils
Version:
前端模块化 JavaScript 工具库
58 lines (50 loc) • 1.31 kB
JavaScript
import { encode as encode$1, decode as decode$1, utf8Encode as utf8Encode$1, utf8Decode as utf8Decode$1, decodeAsBytes as decodeAsBytes$1 } from './base64.mjs';
/**
* base64 加密
* @param {String} str 字符串
* @returns {String} 返回加密后的字符串
*/
function encode(str) {
return encode$1(str);
}
/**
* base64 解密
* @param {String} str 字符串
* @returns {String} 返回解密后的字符串
*/
function decode(str) {
return decode$1(str);
}
/**
* base64 utf8加密
* @param {String} str 字符串
* @returns {String} 返回加密后的字符串
*/
function utf8Encode(str) {
return utf8Encode$1(str);
}
/**
* base64 utf8解密
* @param {String} str 字符串
* @returns {String} 返回解密后的字符串
*/
function utf8Decode(str) {
return utf8Decode$1(str);
}
/**
* base64 加密字节数组
* @param {Array} array 数组
* @returns {String} 返回加密后的字符串
*/
function encodeAsBytes(array) {
return encode$1(array);
}
/**
* base64 解密字节数组
* @param {String} str 字符串
* @returns {Array} 返回解密后的字节数组
*/
function decodeAsBytes(str) {
return decodeAsBytes$1(str);
}
export { decode, decodeAsBytes, encode, encodeAsBytes, utf8Decode, utf8Encode };