Question: I'm trying to find out how to build nice and short alpha numeric hashes like the kind used in youtube urls.

Example: <http://www.youtube.com/watch?v=rw71YOSXhpE>

Where rw71YOSXhpE would convert into video number 12834233 (for example).

These integers could be reversed in PHP to an integer and then looked up in a database.

I've run the following in PHP:

```
<?
$algoList = hash_algos( );

foreach( $algoList as $algoName )
{
    echo $algoName . ": " . hash( $algoName, 357892345234 ) . "\n";
}
?>

```

But none of them come back with characters beyond the a-f you'd expect. Youtube have the whole english alphabet in upper and lower case. Any idea how they've done it?

Answer: 
You could use [base\_convert()](http://php.net/manual/en/function.base-convert.php) to convert your number into base 36, which uses 0-9 plus a-z, and which has the advantage that your URL parameter is not case-sensitive.
Something similar could be done with [`base64_encode()`](http://php.net/manual/en/function.base64-encode.php).