Project: MD5 Message Digest Unit
Unit: PJMD5
Class: TPJMD5
Applies to: ~>1.0
property ReadBufferSize: Cardinal;
TPJMD5 buffers data read from streams and files. The size of the buffer is customisable. Read this property to find the buffer size in bytes. Set the property to change the buffer size.
The default buffer size is specified by the DefReadBufferSize class constant.
The following code reads data from a file in 1Kb chunks:
var
MD5: TPJMD5;
begin
MD5 := TPJMD5.Create;
try
MD5.ReadBufferSize := 1024;
MD5.ProcessFile('MyFile1.txt');
ShowMessage(MD5.Digest); // Digest implicitly cast to string
finally
MD5.Free;
end;
end;