Function “calculateStrongChecksum”
function calculateStrongChecksum(path)
Calculates the "strong" checksum for a given file
This function calculates a SHA512-224 checksum of the file. This can be used to uniquely identify the file contents. For a faster check that usually yields a unique checksum, use
calculateWeakChecksumfirst and only compute the strong checksum if the weak checksums are equal.
Parameters
| Name | Type | Description |
|---|---|---|
path | string | Path or URL of the file to read |
Return Value
Returns the 224-bit checksum of the file encoded as a hex string.
Example
if (calculateStrongChecksum("image1.jpg") == calculateStrongChecksum("image2.jpg"))
print("The two files are identical");
else
print("The two files are not identical");