The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Unit: SDL_matrix
Class: TMat4D
Declaration: [1] function CRCofData: string;
[2] function CRCofData (Sample: integer): string;

The function CRCofData calculates a 256-bit CRC code over all cells of the hypercube matrix. This CRC code is returned as a hexadecimal string of 64 characters. This function comes in two overloaded versions. Version [2] 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 Sample. Setting Sample to a value of 1 is equivalent to using version [1].

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: The method CRCofData triggers the OnPercentDone event to allow to implement a progress indicator when working with large files.

Last Update: 2017-Apr-19