This commit is contained in:
MeiMei 2020-01-27 05:37:53 +09:00 committed by syuilo
parent 0c1076c917
commit 01c07d120f
1 changed files with 2 additions and 2 deletions

View File

@ -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;