Also,  the AMQP specification defines uuid as 16-bytes.

-Ted

On 02/22/2013 11:29 AM, Ken Giusti wrote:
Hi Darryl,

Proton represents the UUID as binary, hence the 16 byte array.  For string 
representations, such as Ruby's, that would have to be converted to ascii/utf8 
hex, and would require the 32 bytes for proper representation.

In python, we have to manually convert the uuid in pn_data_t format into the 
native python uuid object type - see bindings/python/proton.py.  Sounds like 
you'll have something similar in ruby.

Aside, I think the V# type just indicates the method used for generating the 16 
 byte uuid.  V4 uses a random number generator, for example.  I think the sizes 
are all 16 byte.

-K

----- Original Message -----
In writing the Qpid::Proton::Data class I hit a stumbling block with
handling the UUID node type. The pn_uuid_t type is a 16-byte struct,
but
what we get in Ruby is a 32 character string [1] which generates a V4
UUID.

So my question is, what sort of UUID are we trying to represent? With
the size in the pn_uuid_t type we can only hold a V1 UUID. I think we
should expand it to be a 32-bytes to hold larger modern UUIDs.

[1]
http://www.ruby-doc.org/stdlib-1.9.3/libdoc/securerandom/rdoc/SecureRandom.html#method-c-uuid

--
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/



Reply via email to