[Development] What's our policy on changing the result of qHash(T, 0) between major releases?
Giuseppe D'Angelo
giuseppe.dangelo at kdab.com
Sun Feb 4 15:12:18 CET 2024
Il 03/02/24 22:08, Thiago Macieira ha scritto:
> But what about a zero seed? It's what we call a "deterministic hashing". We
> have changed the algorithms on .0 releases (in both 5.0 and 6.0 for QString).
I don't think it means "deterministic" in the sense that the output will
never change across Qt versions. It just means deterministic across
multiple runs of the very same application using the very same Qt version.
When you disable QHash seeding, the choice of making the seed equal to 0
is just "a choice"; we could make it 42 or 0xF0CACC1A, for what is
worth. qHash can still change its output at any time across Qt versions
and software should never ever rely on that.
My 2 c,
--
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - Trusted Software Excellence
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4244 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20240204/e1552364/attachment.bin>
More information about the Development
mailing list