Nathan,
> Take a look at the version 3 or version 5 UUIDs. They essentially do this.
> The hash isn't reversable, but rather recreatable. Seems that if it
> were reversable, it would be compression, not a hash. Anyway.
Hmmm, yes, true.
> You're assuming though that you want to leak this information. If you do,
> or you don't care, go ahead with the v3 or v5 uuid creator.
>
> Or use v1 if you want mac/time based uuids, or v4 for random uuids.
>
> The convenient thing about using the uuid library is that all of these
> mechanisms result in the same type, and are thus compatible.
That's good, it gives users options. And I can see why you don't want to
re-create the functionality in PG code, it's probably pretty large.
> > I've never understood the complex measures which
> > application developers take to create "universal" IDs.
>
> Different applications have different goals. Unguessability might
> be important in some contexts.
Well, IMHO, if the unguessability of UUIDs is an important part of your spec,
you have some design problems. But it's not my job to lock up the
foot-guns, just to make sure they come with warnings ...
--
Josh Berkus
Aglio Database Solutions
San Francisco