Any libraries for UUID? I am using <https://github...
# multiplatform
v
Any libraries for UUID? I am using https://github.com/benasher44/uuid and finding that it is nothing but a steaming pile of garbage. The library limits strings to certain lengths for uuid generation, it seems you must already have a UUID generated or generate one randomly, unacceptable
๐Ÿ‘Ž๐Ÿผ 1
sad panda 1
๐Ÿ‘Ž๐Ÿป 1
๐Ÿคฆโ€โ™‚๏ธ 2
๐Ÿ‘Ž 18
k
You should check your tone when talking about other people's libraries in public like this. Ben is a good engineer. I doubt you will receive help the way you're asking. I certainly won't help you and hopefully neither will he.
โž• 23
e
Well, unacceptable is relative to the goal of the library author. You're free to implement your own, or fork it if the license permits it. That's certainly not the way to go around open source software.
โž• 2
t
Calling an open source library a "steaming pile of garbage" is a great way to not get the response you want. Be kind. Our community deserves better, Vishnu.
โœ… 4
v
I have nothing against the developer at all, I do not consider myself a bad developer yet I have made very bad things and published them. I love this community and all the people in it but I have only so much time to work on my projects, and when something does not make the cut I have to call it out. I may have been a bit upset and I realize maybe I should be a bit kinder but I have tried for hours to find this functionality only to find it does not exist. Furthermore there is next to no documentation, so I hope my fellow developers understand where I am coming from. I really should not have to read through library source to understand the libraries functions.
๐Ÿ‘Ž 4
๐Ÿ‘Ž๐Ÿป 1
So it seems no one is willing to help here, in case anyone ends up searching this and would like to know how to fix this. The library does not implement a hasher, but does know how to use one if you provide it. Considering hashing is an integral part of how UUID's work, this is a problem. the
Copy code
nameBasedUuidOf
function is what you need to use for this. You will need to pick a UUID namspace, i picked x500 and call uuidFrom on that, and you will need to implement the UUIDHasher interface. A easy way to do this is to bridge this library https://github.com/KotlinCrypto/hash this should be a dependancy and implmented but it seems that users of the library must learn the entirety of the UUID algorithm if they want to use this. I used uuid5 with SHA1 but you can pick and choose really. I believe this should help anyone who stumbles across this