I have a 40 character long SHA1 value that is stored in an indexed column in a InnoDB table. To shorten the index I want it to be "compressed" without increasing the risk for a collision.
<?php
$a = "875e5d6959da75400c837a79ecca23d79b40e7a5";
$b = base_convert($a, 16, 36);
echo $b; // ft92zicmcfks08088wk0oow44oso8gk
?>
It this solution ok? And why can't I convert to base64, it gives me the following warning:
Warning: base_convert(): Invalid "to base" (64) in...