{$i uint32.inc}\r
\r
type\r
- dvar=array[0..0] of byte;\r
+ dvar=array[0..65535] of byte;\r
Tmd5state=record\r
buf:array[0..63] of byte;\r
H:array[0..3] of uint32;\r
\r
procedure getmd5(const data;len:longint;var result);\r
\r
-function md5tostr(const md5:tmd5):string;\r
+function md5tostr(const md5:tmd5):ansistring;\r
\r
implementation\r
\r
-function inttohex(val,bits:integer):string;\r
+function inttohex(val,bits:integer):ansistring;\r
const\r
- hexchar:array[0..15] of char='0123456789abcdef';\r
+ hexchar:array[0..15] of ansichar='0123456789abcdef';\r
begin\r
inttohex := hexchar[val shr 4]+hexchar[val and $f];\r
end;\r
b := state.msglen and 63;\r
\r
inc(state.msglen,len);\r
- while (state.msglen > $20000000) do begin\r
+ while (state.msglen >= $20000000) do begin\r
dec(state.msglen,$20000000);\r
inc(state.msglenhi);\r
end;\r
md5finish(t,result);\r
end;\r
\r
-function md5tostr(const md5:tmd5):string;\r
+function md5tostr(const md5:tmd5):ansistring;\r
var\r
a:integer;\r
- s:string;\r
+ s:ansistring;\r
begin\r
s := '';\r
for a := 0 to 15 do s := s + inttohex(md5[a],2);\r