Comments (3)
As a work around for now, specifying the uuid string of the namespace does in fact work:
iex> UUID.uuid5("6ba7b812-9dad-11d1-80b4-00c04fd430c8", "hi.bye")
"e1cd0925-0852-5171-9e44-5fce3d17ee7d"
Here is a list of uid namespaces:
http://stackoverflow.com/questions/10867405/generating-v5-uuid-what-is-name-and-namespace
The UUID RFC pre-defines four namespaces for you:
NameSpace_DNS: {6ba7b810-9dad-11d1-80b4-00c04fd430c8}
NameSpace_URL: {6ba7b811-9dad-11d1-80b4-00c04fd430c8}
NameSpace_OID: {6ba7b812-9dad-11d1-80b4-00c04fd430c8}
NameSpace_X500:{6ba7b814-9dad-11d1-80b4-00c04fd430c8}
Using the atoms does not work, it looks like the issue might be in this line
https://github.com/zyro/elixir-uuid/blob/master/lib/uuid.ex#L330
Might be the wrong type of encoding compared to erlang version? https://github.com/avtobiff/erlang-uuid/blob/master/src/uuid.erl#L193
The nil namespace works, since it's all zeros. https://github.com/zyro/elixir-uuid/blob/master/lib/uuid.ex#L337
from elixir-uuid.
You're right, looks like it was a binary encoding issue. Thanks for the thorough investigation!
I've released an updated version: https://hex.pm/packages/uuid/1.1.6
Closed by #27.
from elixir-uuid.
cool! Thanks for merging. I assume you're going to update the readme too? I think the uuid3 and uuid5 examples on it might be wrong too.
from elixir-uuid.
Related Issues (20)
- Offer safe functions that return error tuples on failure instead of raising an exception HOT 3
- UUID.uuid1 fails on docker for mac beta
- Warnings with Erlang 19.0 HOT 2
- uuid1 issue on osx ? HOT 13
- Name collides with erlang UUID package HOT 4
- UUID.valid?/2 HOT 1
- Instructions in the README don't show change in version and package-name HOT 1
- could not find an app file at "_build/prod/lib/uuid/ebin/uuid.app" HOT 5
- function UUID.uuid4/0 is undefined (module UUID is not available) HOT 3
- string_to_slug and vice versa
- could not find an app file at "_build/dev/lib/uuid/ebin/uuid.app". HOT 1
- uuid1/0 is slow because it gets the MAC address every time HOT 10
- UUID.info parses invalid uuid as valid HOT 1
- V6 UUID HOT 2
- New releases not available on hex.pm HOT 3
- What is this state of this project? HOT 11
- Add a note about the rename in the 1.1 documentation HOT 2
- Non-unique values for UUID.uuid4/0 HOT 2
- Crypto warning when compiling HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elixir-uuid.