From 50ba876daf2341f31f52772008b8ca49ac739b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A7=89?= Date: Thu, 16 May 2024 19:55:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=A4=96=E9=83=A8md5?= =?UTF-8?q?=E5=BC=95=E7=94=A8,=20=E4=BD=BF=E7=94=A8=E6=A0=87=E5=87=86?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 4 ++-- package.json | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 356080c..cc37b41 100644 --- a/index.js +++ b/index.js @@ -5,10 +5,10 @@ import session from 'express-session' import sessionDb from 'express-session-nedb' import random from 'string-random' import formidable from 'formidable' -import md5 from 'md5-node' +import crypto from 'crypto' import HUB from './fmhub.js' - +const md5 = (str) => crypto.createHash('md5').update(str).digest('hex') const databases = new Map() // 所有数据库 const FM = new HUB() // 频道消息分发器 const messagelist = new Map() // 消息队列的nedb存储 diff --git a/package.json b/package.json index ed308a6..02c5a56 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,6 @@ "formidable": "^2.0.1", "interrelated": "^2.0.0-0", "level": "^7.0.1", - "md5": "^2.3.0", - "md5-node": "^1.0.1", "nedb": "^1.8.0", "string-random": "^0.1.3" },