sacnview
sacnview copied to clipboard
CID generation is wrong
CIDs are being generated by the following code:
CID CID::CreateCid()
{
QUuid uuid = QUuid::createUuid();
QByteArray bits = uuid.toByteArray();
CID result;
memcpy(result.m_cid, bits.data(), CIDBYTES);
return result;
}
This is simply incorrect. QUuid::toByteArray() returns a string representation of the UUID, eg:
{d6baa5c0-c5e9-48eb-bba3-f64a86f29ef8}
Fortunately the string representation is always larger than the 16 bytes, and is fairly unique.
The correct call is QUuid::toRfc4122() to get the big-endian representation.