Re: [PATCH 2/3] MINOR: Add `ha_generate_uuid_v7`

2024-04-25 Thread Willy Tarreau
On Thu, Apr 25, 2024 at 08:15:30PM +0200, Tim Düsterhus wrote: > Hi > > On 4/24/24 08:39, Willy Tarreau wrote: > > Just thinking about all the shifts above, I think you could have > > gone through less efforts by acting on 64-bit randoms (less shifts). > > But the difference is probably not that

Re: [PATCH 2/3] MINOR: Add `ha_generate_uuid_v7`

2024-04-25 Thread Tim Düsterhus
Hi On 4/24/24 08:39, Willy Tarreau wrote: Just thinking about all the shifts above, I think you could have gone through less efforts by acting on 64-bit randoms (less shifts). But the difference is probably not that much anyway. I've used the existing implementation for UUIDv4 as the basis,

Re: [PATCH 2/3] MINOR: Add `ha_generate_uuid_v7`

2024-04-24 Thread Willy Tarreau
Hi Tim! On Fri, Apr 19, 2024 at 09:01:26PM +0200, Tim Duesterhus wrote: > +/* Generates a draft-ietf-uuidrev-rfc4122bis-14 version 7 UUID into chunk > + * which must be at least 37 bytes large. > + */ > +void ha_generate_uuid_v7(struct buffer *output) > +{ > + uint32_t rnd[3]; > +

[PATCH 2/3] MINOR: Add `ha_generate_uuid_v7`

2024-04-19 Thread Tim Duesterhus
This function generates a version 7 UUID as per draft-ietf-uuidrev-rfc4122bis-14. --- include/haproxy/tools.h | 1 + src/tools.c | 25 + 2 files changed, 26 insertions(+) diff --git a/include/haproxy/tools.h b/include/haproxy/tools.h index