Possible Duplicate:
php short hash
I need to generate a short hash. The shortest possible from urls say under 6 characters.
I need them to be unique just for the same domain, so a hash from
www.example.com/category/sth/blablabla
must be different than one from
www.example.com/category2/sth/blabla
but not from:
www.example2.com/category/sth/blablabla
Would using md5($url)
and then picking some 5 characters out of that result (for example the first, last, middle and 2 other characters) give and unique id?
Would this abbreviated hash be unique as well?