Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

get_checksum()

Description

Return a checksum for the given file path.

Parameters

ColumnTypeDefaultDescription
$path string Path to file

Return

string

Location

include/file_functions.php lines 91 to 112

Definition

 
function get_checksum($path)
    {
    
debug("get_checksum( \$path = {$path} );");
    global 
$file_checksums_50k;
    if (!
is_readable($path))
        {
        return 
false;    
        }

    
# Generate the ID
    
if ($file_checksums_50k)
        {
        
# Fetch the string used to generate the unique ID
        
$use=filesize_unlimited($path) . "_" file_get_contents($path,null,null,0,50000);
        
$checksum=md5($use);
        }
    else
        {
        
$checksum=md5_file($path);
        }
    return 
$checksum;
    }

This article was last updated 11th July 2020 23:05 Europe/London time based on the source file dated 22nd April 2020 14:54 Europe/London time.