This commit is contained in:
MeiMei 2020-01-27 05:37:53 +09:00 committed by syuilo
parent 2e6e3c351d
commit 68aa92631e

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;