|Thanks for the nice wrapper library. It saved me some time.|
Before discovering it, I had already had the time to begin writing my own, and wrote a function that generates proper UUIDs, which are much nicer than the uniqid() PHP output.
This function outputs what DreamHost really wants:
// Calculate an MD5 of milliseconds & seconds since epoch, and a random number between 0 and getrandmax()
// Example: 0.84404300 1359380852 1828891132
$weak_uuid = md5( microtime( FALSE ) . rand() );
// Format like a UUID (turns 550e8400e29b41d4a716446655440000 into 550e8400-e29b-41d4-a716-446655440000)
$weak_uuid = substr( $weak_uuid, 0, 8 ) .
"-" . substr( $weak_uuid, 8, 4 ) .
"-" . substr( $weak_uuid, 12, 4 ) .
"-" . substr( $weak_uuid, 16, 4 ) .
"-" . substr( $weak_uuid, 20, 12 );
// Return the non-crypto-secure UUID (it's not random enough for serious security uses!)