]> git.proxmox.com Git - mirror_qemu.git/commit
util/uuid: add a hash function
authorAlbert Esteve <aesteve@redhat.com>
Mon, 2 Oct 2023 06:57:03 +0000 (08:57 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 4 Oct 2023 22:15:06 +0000 (18:15 -0400)
commita6ceee591acdb9c9c772bf59544a57891308222e
tree79cadd8681bb2324c370cf64b17b2b2e3855df31
parent70f88436aa5a8aeddd33e4d06270146af5d5bb52
util/uuid: add a hash function

Add hash function to uuid module using the
djb2 hash algorithm.

Add a couple simple unit tests for the hash
function, checking collisions for similar UUIDs.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Message-Id: <20231002065706.94707-2-aesteve@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
include/qemu/uuid.h
tests/unit/test-uuid.c
util/uuid.c