We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bebe606 commit 16663a5Copy full SHA for 16663a5
Source/simba.hash.pas
@@ -71,12 +71,10 @@ function HashFile(Algo: EHashAlgo; const FileName: String): String;
71
72
try
73
Stream := TFileStream.Create(FileName, fmOpenRead);
74
- if (Len = -1) then
75
- Len := $FFFFFF;
76
- SetLength(Bytes, Min(Len, Stream.Size - Offset));
77
- if (Length(Bytes) > 0) then
+ if (Stream.Size > 0) then
78
begin
79
- Stream.Seek(Offset, soBeginning);
+ SetLength(Bytes, Stream.Size);
+ Stream.Seek(0, soBeginning);
80
Stream.ReadBuffer(Bytes[0], Length(Bytes));
81
end;
82
except
0 commit comments