mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
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>
This commit is contained in:
parent
70f88436aa
commit
a6ceee591a
3 changed files with 43 additions and 0 deletions
|
@ -96,4 +96,6 @@ int qemu_uuid_parse(const char *str, QemuUUID *uuid);
|
|||
|
||||
QemuUUID qemu_uuid_bswap(QemuUUID uuid);
|
||||
|
||||
uint32_t qemu_uuid_hash(const void *uuid);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue