The Juno library has a 'uuid' that works like that, and the posted example seems to build ok here using DMD 1.062. Theres also a Tango version of the same code in the dwin library, but i haven't tried that for ages.