Image Unique Identifier

Ramon Leon ramon.leon at allresnet.com
Tue Aug 22 21:22:19 UTC 2006


Speaking of UUID's, I have a need for something like a UUID, but shorter,
more human readable.  I'd be fine with a UUID, but the biz folks don't like
em.

A buddy and I came up with the following...

(String streamContents: [:string | 
    (MD5 hashMessage: UUID new) 
        do: [:each | string nextPutAll: (each printStringBase: 36)]]) 
truncateTo: 16

It does an MD5 hash on a GUID, then takes the base36 string of each
resulting number, and chops the string to a length of 16.  I'm just guessing
on the 16, might try it longer or shorter, hopefully shorter.  Was wondering
if anyone had any comments about this, or an alternate approach?




More information about the Squeak-dev mailing list