-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UUID should support to and from standard uuid formats. #680
Comments
I agree with this request, this one I made more than 10 years ago and I still think this would be handy... at least the one to get a printable string. |
Despite its name, zim's uuid is only a unique id stored in 128 bits, it is not a standard UUID (which is also a unique id stored in 128 bits, but with more constraints) But anyway, there is already a (two) way(s) to convert a uuid to "standard" formats 8-4-4-4-12 (https://github.com/openzim/libzim/blob/master/src/uuid.cpp#L86-L110) UUID can also be constructed from raw binary data (which is not a standard representation). We could indeed add a constructor from a textual representation 8-4-4-4-12 to help manipulation of the uuid. |
@kelvinhammond Good enough? |
I'll bind this to nodejs as is and whatever library wants to use |
@mgautierfr Would that be a good id that in the future we allow only proper uuids? |
I don't see the added value to this. We would need to depend on a uuid library to generate the uuid (or check it is a valid one) and it would be useless (old zim files would still have invalid uuid so we couldn't convert zim uuid to standard UUID) |
@mgautierfr The |
It is false. We don't use libuuid. |
@kelvinhammond It seems we have a way in the libzim to print the UUID. Does the answer of @mgautierfr is satisfying to you? |
The UUID format should support converting to and from the standard display format(s).
See https://en.wikipedia.org/wiki/Universally_unique_identifier#Format
https://github.com/openzim/libzim/blob/master/src/uuid.cpp
Currently there is not a good way to display the UUID to the user or application and then load that UUID back to a zim::UUID
The text was updated successfully, but these errors were encountered: