ramsey / uuid

:snowflake: A PHP library for generating universally unique identifiers (UUIDs).
https://uuid.ramsey.dev
MIT License
12.45k stars 501 forks source link

Generate uuid version 6? #228

Closed mikemix closed 4 years ago

mikemix commented 6 years ago

Any future plans for generating version 6 uuid?

https://bradleypeabody.github.io/uuidv6/ https://github.com/kurttheviking/uuid-with-v6-js#why

ramsey commented 6 years ago

I’m interested in it, but I’m waiting to see if they will put it through the formal IETF RFC process. I’m not going to adopt a v6 that could potentially change in the future because of competing implementations.

mikemix commented 6 years ago

Sure thing :( Check this out https://github.com/mikemix/php-uuid-v6

ramsey commented 6 years ago

That's cool. I was going to say it should be fairly easy to do in terms of extending this library for your own purposes, but @mikemix already has. :smile:

I'll gladly add v6 to this official library if and when it becomes an IETF standard. Until there is a community effort to codify a version 6 UUID, encoding it with "6" in the version field will lead to interoperability issues, and I don't want this library to add to the confusion.

ramsey commented 6 years ago

Just be aware: if you use "version 6" UUIDs now and a standard comes along that is even slightly different in positions of bytes, the UUIDs you generate now will be incompatible with the standard.

ramsey commented 6 years ago

I left a comment on the version 6 proposal page: http://disq.us/p/1sjxmaj

ramsey commented 4 years ago

Version 6 UUIDs (as specified in http://gh.peabody.io/uuidv6/) are now supported in ramsey/uuid 4.0.0-alpha4. Thanks, and sorry for the extremely long wait on this!

taylorgoolsby commented 4 years ago

@ramsey It looks like the peabody draft expired. I'm trying to decide if I should use peabody's draft for UUID v6 in prod now. I'd like to know what you think about this. In the past you wanted to upgrade to v6 only if it became an IETF standard, but it's not quite there yet. How certain are you that the encoding won't change between peabody's draft and become an IETF standard?

oittaa commented 2 years ago

@taylorgoolsby the draft has been updated.

https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-02

Expires: 10 April 2022