Title: identifying files
Question: Generating file specific information isnt always easy. Reading a certain number of bytes from a file is also not very appropriate. Because if the changes made to that file arent in the range which was read, it is not very effective.
The following routine doesnt take file contents, but the file size plus the date and time stamp.
Answer:
function GenerateCheckSum (filename: string): int64;
var fdatetime, fsize: dword;
checksum: int64;
begin
checksum := (17 * fdatetime) div fsize;
checksum := checksum + ((8 * fdatetime) mod fsize);
checksum := checksum + abs((9 * fsize) - round(sqrt(fdatetime)));
checksum := 2 * checksum - (fsize + fdatetime);
GenerateCheckSum := checksum;
end;
The equations used in this example are simply examples. You can modify them as you want.
(It may also be possible to get this working on older versions of Delphi.)