I've noticed the base 64 encoded UUID _message param is longer than it
needs to be.

A UUID has 128 bits, a base 64 character has 6 bits, so a base 64
encoding of a UUID can be achieved with 22 characters. The current
_message strings are about 53 characters (made worse because standard
base 64 contains '+', '/', and '=' which need to be url encoded).

The merb code is probably performing the following: UUID -> ASCII hex -
> Base 64,
in the ASCII HEX step the UUID is converted to something like
"550e8400-e29b-41d4-a716-446655440000" which is then base64 encoded.
ASCII obviously ranges over much more than [0-9a-f] so the resulting
base64 encoding is sparse.

I realise that the code is probably using some UUID generator + the
Base64 class, so the resulting 53 characters, though monstrous, is
'canonical'.

I've created my own class to generate UUIDs, it's not efficient and
almost a bodge, but serves my purposes for now, they may not be
'canonical' but are much smaller.

http://pastie.org/367558


Stacy.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to