From 01c07d120f6b234aba0c17592e11da1330f21cb8 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Mon, 27 Jan 2020 05:37:53 +0900 Subject: [PATCH] Resolve #5762 (#5770) --- src/misc/id/aid.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/id/aid.ts b/src/misc/id/aid.ts index 530d84e582..c49a084573 100644 --- a/src/misc/id/aid.ts +++ b/src/misc/id/aid.ts @@ -1,10 +1,10 @@ // AID // 長さ8の[2000年1月1日からの経過ミリ秒をbase36でエンコードしたもの] + 長さ2の[ノイズ文字列] -import * as cluster from 'cluster'; +import * as crypto from 'crypto'; const TIME2000 = 946684800000; -let counter = process.pid + (cluster.isMaster ? 0 : cluster.worker.id); +let counter = crypto.randomBytes(2).readUInt16LE(0); function getTime(time: number) { time = time - TIME2000;