示例#1
0
/**
 * Generate a UNIQUE string for a given file path to use as the identifier for the file
 * The string returned should be 32 characters in length
 * @param string $p_filepath File path.
 * @return string
 */
function file_generate_unique_name($p_filepath)
{
    do {
        $t_string = md5(crypto_generate_random_string(32, false));
    } while (!diskfile_is_name_unique($t_string, $p_filepath));
    return $t_string;
}
示例#2
0
function file_generate_unique_name($p_seed, $p_filepath)
{
    do {
        $t_string = file_generate_name($p_seed);
    } while (!diskfile_is_name_unique($t_string, $p_filepath));
    return $t_string;
}