Well you can compare checksum with some hash function like MD5
or SHA1
For MD5
Assuming you use Java
for Android function will be like this
public static String checkSum(String path){
String checksum = null;
try {
FileInputStream fis = new FileInputStream(path);
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] buffer = new byte[8192];
int numOfBytesRead;
while( (numOfBytesRead = fis.read(buffer)) > 0){
md.update(buffer, 0, numOfBytesRead);
}
byte[] hash = md.digest();
checksum = new BigInteger(1, hash).toString(16);
} catch (IOException ex) {
} catch (NoSuchAlgorithmException ex) {
}
return checksum;
}
For PHP
its much easier, you can just use md5_file
function
$md5 = md5_file($filepath);