source/Core/UniversallyUniqueIdGenerator.php
protected function _generateBasedOnOpenSSL()
    {
        $sRandomData = openssl_random_pseudo_bytes(16);
        $sRandomData[6] = chr(ord($sRandomData[6]) & 0x0f | 0x40); // set version to 0100
        $sRandomData[8] = chr(ord($sRandomData[8]) & 0x3f | 0x80); // set bits 6-7 to 10

        return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($sRandomData), 4));
    }
protected function _generateBasedOnOpenSSL()
    {
        $sRandomData = openssl_random_pseudo_bytes(16);
        $sRandomData[6] = chr(ord($sRandomData[6]) & 0x0f | 0x40); // set version to 0100
        $sRandomData[8] = chr(ord($sRandomData[8]) & 0x3f | 0x80); // set bits 6-7 to 10

        return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($sRandomData), 4));
    }
protected function _generateBasedOnOpenSSL ( ) { $ sRandomData = openssl_random_pseudo_bytes ( 16 ) ; $ sRandomData [ 6 ] = chr ( ord ( $ sRandomData [ 6 ] ) & 0x0f | 0x40 ) ; // set version to 0100 $ sRandomData [ 8 ] = chr ( ord ( $ sRandomData [ 8 ] ) & 0x3f | 0x80 ) ; // set bits 6-7 to 10 return vsprintf ( '%s%s-%s-%s-%s-%s%s%s' , str_split ( bin2hex ( $ sRandomData ) , 4 ) ) ; }
Generates UUID based on OpenSSL's openssl_random_pseudo_bytes.

@return string
Generates UUID based on OpenSSL s openssl_random_pseudo_bytes .