lithammer / shortuuid

:mushroom: A generator library for concise, unambiguous and URL-safe UUIDs

Home Page:https://pkg.go.dev/github.com/lithammer/shortuuid/v4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UUID Namespace Swapped

ChristianGaertner opened this issue · comments

Hi,

Disclaimer: I'm not an expert in regards to UUIDs, but I just looked over your code and found this odd thing:

https://github.com/renstrom/shortuuid/blob/bc12e561a2565bb6377569675aa276013f9bc5e3/shortuuid.go#L48

It seems like the DNS and URL Namespaces are swapped.

You check for the http prefix and then assign the DNS namespace.

If this is indented, maybe a comment to explain why this is the case would be helpful.

Cheers,

Christian

/facepalm, you're completely correct. What a blunder :) Thanks for noticing!