Thruway\Common\Utils::getUniqueId PHP 메소드

getUniqueId() 공개 정적인 메소드

Generate a unique id for sessions and requests
public static getUniqueId ( ) : mixed
리턴 mixed
    public static function getUniqueId()
    {
        $filter = 0x1fffffffffffff;
        // 53 bits
        $randomBytes = openssl_random_pseudo_bytes(8);
        list($high, $low) = array_values(unpack("N2", $randomBytes));
        return abs(($high << 32 | $low) & $filter);
    }

Usage Example

예제 #1
0
파일: Call.php 프로젝트: binaek89/Thruway
 /**
  * Constructor
  *
  * @param \Thruway\Session $callerSession
  * @param \Thruway\Message\CallMessage $callMessage
  * @param Registration $registration
  */
 public function __construct(Session $callerSession, CallMessage $callMessage, Procedure $procedure)
 {
     $this->callMessage = $callMessage;
     $this->callerSession = $callerSession;
     $this->procedure = $procedure;
     $this->callStart = microtime(true);
     $this->invocationRequestId = Utils::getUniqueId();
 }
All Usage Examples Of Thruway\Common\Utils::getUniqueId