Constants

TWEPOCH

TWEPOCH = 1620750646000

WORKER_ID_BITS

WORKER_ID_BITS = 2

DATACENTER_ID_BITS

DATACENTER_ID_BITS = 2

SEQUENCE_BITS

SEQUENCE_BITS = 5

Properties

$workerId

$workerId : 

Type

$datacenterId

$datacenterId : 

Type

$sequence

$sequence : 

Type

$maxWorkerId

$maxWorkerId : 

Type

$maxDatacenterId

$maxDatacenterId : 

Type

$workerIdShift

$workerIdShift : 

Type

$datacenterIdShift

$datacenterIdShift : 

Type

$timestampLeftShift

$timestampLeftShift : 

Type

$sequenceMask

$sequenceMask : 

Type

$lastTimestamp

$lastTimestamp : 

Type

Methods

__construct()

__construct(  $workerId = 1,   $datacenterId = 1,   $sequence) 

Parameters

$workerId
$datacenterId
$sequence

getId()

getId() 

tilNextMillis()

tilNextMillis(  $lastTimestamp) 

Parameters

$lastTimestamp

timeGen()

timeGen() 

leftShift()

leftShift(  $a,   $b) 

Parameters

$a
$b