dedis / onet

Overlay Network for distributed protocols
GNU Lesser General Public License v3.0
50 stars 29 forks source link

go.uuid import is broken #660

Closed ineiti closed 4 years ago

ineiti commented 4 years ago

After merging of #659 , it turns out that satori/go.uuid is broken and doesn't work as intended with a go-module. As at least one other fork of it, gofrs/uuid, removed go.mod support, I propose go.uuid is replaced with google/uuid.

In the meantime, a workaround can be

    github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect

in onet/go.mod.

nkcr commented 4 years ago

No later than yesterday I had to select a library for generating uuids, this article lists some interesting possibilities: https://blog.kowalczyk.info/article/JyRZ/generating-good-unique-ids-in-go.html (we went with rs/xid because we already use rs/zerolog).

ineiti commented 4 years ago

And why not google/uuid?

ineiti commented 4 years ago

And why use uuids at all? Do you really need them? If I'd had to redo that part of the code, I'd use sha256...

nkcr commented 4 years ago

UUID can offer interesting properties, such as being more compact, or sortable.

ineiti commented 4 years ago

Anyway - just wanted to raise the issue that back in the days (when I was young and started with onet) I chose UUID because I thought it will make it easier to interact with other libraries. Up to now it created more problems than it solved...

At least if you're using random UUIDs (version 4). Perhaps a good usage of version 3 or 5 could help. But I did not encounter a use-case where UUIDs would've helped... YMMV.