Open cmeiklejohn opened 6 years ago
Sorry for not having time to look into this until now.
What environment is used? (erlang-uuid, Errlang, OS versions; from source or package manager etc?)
The UUID you supplied is probably not v1 but v4. Padding to correct length yields UUIDv1.
1> uuid:version(<<158,154,190,66,38,226,17,232,155,216,0,0,0,0>>).
** exception error: bad argument
in function uuid:version/1 (src/uuid.erl, line 348)
2> uuid:version(<<158,154,190,66,38,226,17,232,155,216,0,0,0,0,0,0>>).
1
I suspect that the UUIDv1 somehow use a MAC address that are only zeroes and this does not end up in a 48 bit wide binary but less.
Another suggestion is that this problem arises due to Erlang Time API changes.
This is Amazon Linux.
Now, when I generate identifiers locally, with the same version of Erlang, I'm getting 16 byte identifiers. But, when I run it here, as you can see from the binary above, it's only 14 bytes. This is causing the
uuid:to_string
method to throw, because it doesn't match at line 238. Any thoughts on why this would happen on a particular variant of Linux?I'm using
uuid4()
.