I would like to hash a numeric string because I do not want people to know the exact number for various security and other reasons. How about doing it so?
$number = X; // get my number from wherever
$secret = mt_rand(); // or maybe another randomly generated secret!?
$hash = hash_hmac("sha256", $number, $secret); // or maybe another algo!?
So when I want to retrieve the number, I will just compare the hash generated with the hash returned from the app, which is already stored in the database, and I can lookup the number by this hash. Would this be unique enough to handle a number larger than 64 characters? And, yes, I am serious. This is for statistical data and it will get huge... huge numbers, most probably more than 64 characters long.
Regards!