Well, you are making several mistakes there:
First, you are always poking to the *Buffer position. You never increase
that pointer. So you are basically writing the while file data into the
first byte of your buffer, with each new byte overwriting the old one.
The rest of the buffer is empty. No wonder the fingerprints don't match.
Second, as pointed out by freedimension allready, you are processing
one byte more than the real filesize. This has no real effect here, as
you specify the right size (lof()) at the MD5FingerPrint() command,
but it is still no good thing to do.
Here's a working code:
Code: Select all
Debug MD5FileFingerprint(file)
OpenFile(0,file)
*buffer=AllocateMemory(Lof())
For i=0 To Lof()-1
PokeB(*buffer+i,ReadByte())
Next i
Debug MD5Fingerprint(*buffer,Lof())
voila... the fingerprints match. So it's only file data, nothing else.
Timo