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 calculateWeakChecksum first and only compute the strong checksum if the weak checksums are equal.

Parameters

NameTypeDescription
pathstringPath 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");