function get_hash_entry($hash) { require_once $PHP_INCLUDE_PATH . "validate.php"; if (!isValidHash($hash)) { die($ERROR_MSG); } return lookup_hash($hash); }
function calc_new_hash($input) { $len = 4; $flag = false; while (1) { $hash = custom_hash($input, $len); if (mysql_num_rows(lookup_hash($hash)) == 0) { break; } $len++; } return $hash; }