Compact representation of GUID/UUID?
        Posted  
        
            by chakrit
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by chakrit
        
        
        
        Published on 2010-05-24T19:30:16Z
        Indexed on 
            2010/05/24
            19:41 UTC
        
        
        Read the original article
        Hit count: 604
        
guid
|guid-generation
I need to generate a GUID and save it via a string representation. The string representation should be as short as possible as it will be used as part of an already-long URL string.
Right now, instead of using the normal abcd-efgh-... representation, I use the raw bytes generated and base64-encode them instead, which results in a somewhat shorter string.
But is it possible to make it even shorter?
I'm OK with losing some degree of uniqueness and keeping a counter, but scanning all existing keys is not an option. Suggestions?
© Stack Overflow or respective owner