What is the most efficient way to encode an arbitrary GUID into readable ASCII (33-127)?

Posted by mark on Stack Overflow See other posts from Stack Overflow or by mark
Published on 2010-05-13T14:35:00Z Indexed on 2010/05/13 14:44 UTC
Read the original article Hit count: 236

Filed under:
|

Dear ladies and sirs.

The standard string representation of GUID takes about 36 characters. Which is very nice, but also really wasteful. I am wondering, how to encode it in the shortest possible way using all the ASCII characters in the range 33-127. The naive implementation produces 22 characters, simply because 128 bits / 6 bits yields 22.

Huffman encoding is my second best, the only question is how to choose the codes....

Any more ideas?

Thanks.

P.S.

The encoding must be lossless, of course.

© Stack Overflow or respective owner

Related posts about guid

Related posts about algorithm