[wp-hackers] Time to change GUID to UUID?

Dougal Campbell dougal at gunters.org
Tue May 10 17:38:25 UTC 2011


On May 9 2011 10:45 AM, Eric Mann wrote:
> Matt, great suggestion!
>
> wp_hash() uses MD5 by default ... any reason to use SHA1 over MD5 for this
> purpose?
>
> If not, we could use $uid = wp_hash( microtime() . DB_NAME .
> $post->post_title . $post->ID );
>
> Or, perhaps even better, use a filter so that individual sites can override
> it?

I chose SHA1 pretty arbitrarily in my example. It was really only meant 
to be pseudocode. Using wp_hash seems pretty natural. While I can't 
think of much value in a filter, it wouldn't cost much to toss it in 
there in case someone comes up with a need in the future.

-- 
Dougal Campbell <dougal at gunters.org>
http://dougal.gunters.org/
http://twitter.com/dougal
http://twitual.com/


More information about the wp-hackers mailing list