IDWork
IDWork copied to clipboard
算法有问题,左移都不对
算法有问题。
static $workerIdShift = 10;
static $timestampLeftShift = 14;
这个应该分别是:
static $workerIdShift = 22;
static $timestampLeftShift = 12;
因为: 63 - 41 =22 63 - 51 = 12
另外,10个机器位,为什么要限制机器ID 小于15?小于 1024就行了。