Support for UUID v5

89 views
Skip to first unread message

Matthew Jones

unread,
Feb 18, 2026, 4:22:01 PM (3 days ago) Feb 18
to Chromium-dev, Tommy Nyquist
tl;dr: Do we have tools to support UUID v5 in Chrome?

Hi all,

I'm working on a feature where it would be useful to reproduce a UUID from a unique, non-UUID string. I was thinking this would be a good case for UUID v5, but I found a few limitations when I started to look into it. Notably, the current base::Uuid implementation doesn't keep a byte array, but the formatted lowercase string. Do we have any existing tools to convert base::Uuid to its bytes or some other hidden implementation that supports v5? It looks like we have all the pieces to make this possible in //base (sha1, hex/byte conversion, etc.) but I don't want to reinvent the wheel if I don't have to. My plan was to try this out in our feature code, but if we're broadly looking for a more flexible base implementation, I'd be happy to make the changes there as well.

Any insight is appreciated, thanks!
Matt

Daniel Cheng

unread,
Feb 18, 2026, 4:27:31 PM (3 days ago) Feb 18
to mdj...@chromium.org, Chromium-dev, Tommy Nyquist
FWIW, I think `base::Uuid` really should store bytes and not the formatted lowercase string; then I think v5 support might become trivial. I'm not sure how large a project it would be to change/fix that though.

Daniel

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CADuFyH2ucF-7d_UehoRPDwq4pur0_iXXDbkH%3DtJA2z%2BiPYz40w%40mail.gmail.com.

Avi Drissman

unread,
Feb 18, 2026, 6:55:40 PM (3 days ago) Feb 18
to dch...@chromium.org, mdj...@chromium.org, Chromium-dev, Tommy Nyquist
"When the internal type of base::Uuid changes" says /base/uuid.h (emphasis added) so that's not only you who thinks that.

But that's a bit of a rework.

Avi

Matthew Jones

unread,
Feb 19, 2026, 4:39:23 PM (2 days ago) Feb 19
to Avi Drissman, dch...@chromium.org, Chromium-dev, Tommy Nyquist
Ok so it sounds like there isn't opposition to heading this direction, I'm just the first one to _really_ want it. I do think that making the change to keeping bytes rather than lowercase string would solve most of my problems here, even if I did end up with v5 in my feature's code. I think it'll be easy to hide that change behind the existing api, but we'll see when I go to implement. Thanks for the feedback!
Reply all
Reply to author
Forward
0 new messages