From 44d43f45cb9094619df7494c2a64a51ba77ad116 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Mon, 24 Feb 2025 18:07:08 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=94=AF=E6=8C=81=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=ACLeCDN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/basic/src/utils/util.hash.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/core/basic/src/utils/util.hash.ts b/packages/core/basic/src/utils/util.hash.ts index 8727c436..aab75f72 100644 --- a/packages/core/basic/src/utils/util.hash.ts +++ b/packages/core/basic/src/utils/util.hash.ts @@ -6,7 +6,12 @@ function md5(data: string) { function sha256(data: string) { return crypto.createHash('sha256').update(data).digest('hex'); } + +function base64(data: string) { + return Buffer.from(data).toString('base64'); +} export const hashUtils = { md5, sha256, + base64, };