1
0
mirror of synced 2026-02-19 11:27:56 +08:00

auto commit

This commit is contained in:
zhouzj
2021-03-23 01:53:11 +08:00
parent eec32633d7
commit c433f79504

View File

@@ -40,15 +40,14 @@ namespace Yitter.IdGenerator
throw new ApplicationException("BaseTime error.");
}
if (options.SeqBitLength + options.WorkerIdBitLength > 22)
{
throw new ApplicationException("errorWorkerIdBitLength + SeqBitLength <= 22");
}
if (options.WorkerIdBitLength <= 0)
{
throw new ApplicationException("WorkerIdBitLength error.(range:[1, 21])");
}
if (options.SeqBitLength + options.WorkerIdBitLength > 22)
{
throw new ApplicationException("errorWorkerIdBitLength + SeqBitLength <= 22");
}
var maxWorkerIdNumber = Math.Pow(2, options.WorkerIdBitLength) - 1;
if (options.WorkerId < 0 || options.WorkerId > maxWorkerIdNumber)