UUIDv7
Please support UUIDv7, the best thing to have happened for UUID in a very long time.
you can do
u, _ := uuid.NewV7()
str := shortuuid.DefaultEncoder.Encode(u)
fmt.Println(str) // 2HzMQ9tmpRM37k5Cp52uS8
as a workaround
I wonder if the easiest solution for this would be to just introduce a new shortuuid.NewV7() package level function 🤔
Hey everyone! 👋 I've introduced a package-level shortuuid.NewV7() function that supports UUIDv7. In addition, I've also added encoding support for Namespace, Alphabet etc.
Requesting review. 👀 @lithammer
i am unable to Decode a uuid v7 shortuuid.
uuid v7 -> shortuuid -> decode (should give me the same uuid).
i am unable to Decode a uuid v7 shortuuid.
uuid v7 -> shortuuid -> decode (should give me the same uuid).
@debuggerpk Can you provide more details or examples?
It's working fine for me
u, _ := uuid.NewV7()
fmt.Println(u.String()) // 019aa24c-fd88-74f5-a58c-28739af06bee
str := shortuuid.DefaultEncoder.Encode(u)
fmt.Println(str) // 2JHFghYTjt3mkie6XNysCt
decoded, _ := shortuuid.DefaultEncoder.Decode(str)
fmt.Println(decoded.String()) // 019aa24c-fd88-74f5-a58c-28739af06bee