加密

  // 将 UTF-8 编码的字符串转换为 Base64 编码
  const utf8ToBase64 = (str) => {
    const bytes = new TextEncoder().encode(str);
    return btoa(String.fromCharCode(...bytes));
  };
posted @ 2026-02-26 14:46  银河1992  阅读(2)  评论(0)    收藏  举报