while lOffset < lFileSize do begin { bEndOfData will be true if the current offset + CHUNKSIZE exceeds the end of the file. } vaBytesRead := xHash.ReadFile( 'c:\temp\source.txt', lOffset, CHUNKSIZE, efpHash, (lOffset + CHUNKSIZE >= lFileSize) );
lOffset := lOffset + vaBytesRead; end;
vaHashValue := xSHA.HashValue;
{ Do something with the HashValue... }
ShowMessage( 'Hashing successful!' ); except on xErr : Exception do ShowMessage( xErr.Message ); end;