Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
30
Task/MD4/Delphi/md4.delphi
Normal file
30
Task/MD4/Delphi/md4.delphi
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
program CalcMD4;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
uses
|
||||
System.SysUtils,
|
||||
DCPmd4;
|
||||
|
||||
function MD4(const Str: string): string;
|
||||
var
|
||||
HashDigest: array of byte;
|
||||
d: Byte;
|
||||
begin
|
||||
Result := '';
|
||||
with TDCP_md4.Create(nil) do
|
||||
begin
|
||||
Init;
|
||||
UpdateStr(Str);
|
||||
SetLength(HashDigest, GetHashSize div 8);
|
||||
final(HashDigest[0]);
|
||||
for d in HashDigest do
|
||||
Result := Result + d.ToHexString(2);
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
Writeln(MD4('Rosetta Code'));
|
||||
readln;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue