Search code examples
gouuid

Will gouuid always generate same value on V5


I am using the following package - "https://github.com/nu7hatch/gouuid" in my go app.

I have a question that I am not sure completely.

Will the value of uuid.NewV5(uuid.NamespaceURL, []byte("stackoverflow.com")) will always be same or will it differ system to system?

I mean, if I generate value from uuid.NewV5(uuid.NamespaceURL, []byte("stackoverflow.com")) in ubuntu PC and If I generate value from uuid.NewV5(uuid.NamespaceURL, []byte("stackoverflow.com")) in centos pc.

Will both of them give the same value? If no, then why?

Sorry for asking the noob question, but I am truly unaware of this and want to learn.

Thanks


Solution

  • Bugs aside, any UUIDv5 generator from any library in any language on any operating system on any hardware will generate the same output when given the same input. That's the entire point of UUIDv5.