evseevnn\Cassandra\Protocol\Response\DataStream::readUuid PHP Method

readUuid() public method

Read uuid.
public readUuid ( boolean $isCollectionElement = false ) : string
$isCollectionElement boolean
return string
    public function readUuid($isCollectionElement = false)
    {
        if ($isCollectionElement) {
            $this->readShort();
        }
        $uuid = '';
        $data = $this->read(16);
        for ($i = 0; $i < 16; ++$i) {
            if ($i == 4 || $i == 6 || $i == 8 || $i == 10) {
                $uuid .= '-';
            }
            $uuid .= str_pad(dechex(ord($data[$i])), 2, '0', STR_PAD_LEFT);
        }
        return $uuid;
    }