[Development] What's our policy on changing the result of qHash(T, 0) between major releases?
Thiago Macieira
thiago.macieira at intel.com
Sun Feb 4 18:08:34 CET 2024
On Sunday, 4 February 2024 06:12:18 PST Giuseppe D'Angelo via Development
wrote:
> 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.
Indeed but how would it know that it is the same Qt version? It might be
running with a system Qt that got upgraded in the background, so a new start
would change it. For that matter, it's far more likely that it's an
application and its helper at the same time, but even then they can't
guarantee they're using the same Qt.
> 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.
I'm not sure.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Cloud Software Architect - Intel DCAI Cloud Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5163 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20240204/1639255e/attachment.bin>
More information about the Development
mailing list