I am currently using this code to hash md5 in Delphi 7:
function MD5(const fileName : string) : string; var idmd5 : TIdHashMessageDigest5; fs : TFileStream; begin idmd5 := TIdHashMessageDigest5.Create; fs := TFileStream.Create(fileName, fmOpenRead OR fmShareDenyWrite) ; try result := idmd5.AsHex(idmd5.HashValue(fs)) ; finally fs.Free; idmd5.Free; end; end;
and I'm trying to get the output just like a PHP function
md5_file()
I looked around and the usual problems look like an encoding rather than padding with zeros, but I donβt know how to do this using TIdHashMessageDigest5, or they are already executed in this function.
If anyone has any features that they use for this, it will be very useful!
Or perhaps a way to change the php function to match Indy one
Mikey source share