At 02:28 -0800 1/22/09, Stacy Curl wrote:
> 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. ...

I did this for a project, but I also added a checksum.  Two bits
were left over in the Base64 encoding, so adding an extra byte gave
me just 1 in 1024 chance of accepting (say) a typo as a valid UUID.
The code is available at http://pastie.org/368006.

-r
-- 
http://www.cfcl.com/rdm            Rich Morin
http://www.cfcl.com/rdm/resume     [email protected]
http://www.cfcl.com/rdm/weblog     +1 650-873-7841

Technical editing and writing, programming, and web development

--~--~---------~--~----~------------~-------~--~----~
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