protected function _getTransactionId()
{
if ($this->_txId < 0) {
$myEpoch = strtotime('2014-12-01');
$myNow = microtime(true) - $myEpoch;
$myNowMS = (int) ($myNow * 1000);
$Shifted = $myNowMS << 12;
$this->_txId = $Shifted + mt_rand(0, 4095);
# remove sign
# treat as unsigned even when the INT is signed
# and take 4 Bytes
# ( 32 bit uniqueness is not ensured in any way,
# but is surely unique in this session )
# we need only a transaction unique for this session
# not a real UUID
if ($this->_txId & 0x80000000) {
$this->_txId = $this->_txId - 0x80000000 & 0xffffffff;
} else {
$this->_txId = $this->_txId & 0xffffffff;
}
}
return $this->_txId;
}