Closed pedroalbanese closed 1 year ago
Hi pedroalbanese!
This is by design of version 1 UUIDs. The last six octets are the node id, which is the mac address of the host generating the UUID in this case. Have a look at https://www.rfc-editor.org/rfc/rfc4122#section-4.1.2 for details about the format. If you want to create randomly generated UUIDs you should use the New() func instead of NewUUID(), which returns a version 4 UUID. Also, this module allows you to set the node id to a custom value using SetNodeId() if you like. However, you should read section 4.5 of the RFC to learn about the caveats and how to avoid collisions.
Best regards!
Thank you very much!
Greetings!
I would like to know why version 1 repeats the ends of sequences, ie using NewUUID() the results always end in -0022684e5e1b. Is there a way to change this or a purpose for this to occur?
Thanks in advance.