CalcCRC

Declaration: TMat4D.CalcCRC (Sampling: integer; var CRC256: string): integer;
The function CalcCRC calculates a 256-bit CRC code over all cells of the hypercube matrix. This CRC code is returned in the variable parameter CRC256 as a hexadecimal string of 64 characters. This function allows to speed up the calculation of the CRC code by using only every nth value of the data matrix, with n being controlled by the parameter Sampling. Setting Sampling to a value of 1 is equivalent to using all cells of the hybercube.

Hint 1: Please note that the CRC code cannot be unique but there is only an extremely small chance to get a hash code collision. Thus the CRC code can be used to check whether two matrices are different (if the CRCs differ the matrices must be different), however there is a very small chance that the CRCs of different matrices are equal.

Hint 2: Calculating the CRC code is inherently slow given that most hyperspectral images are rather big. While using a large Sampling parameter speeds up the function considerably the uniqueness of the CRC code suffers from high sampling parameters. In general it should be avoided to use integer powers of 2 as sampling factors. We recommend to use prime numbers instead (to avoid accidential alignment of the sampling distance to common repetitive patterns in binary datasets).