Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/SHA-256/Free-Pascal/sha-256.pas
Normal file
28
Task/SHA-256/Free-Pascal/sha-256.pas
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
program rosettaCodeSHA256;
|
||||
|
||||
uses
|
||||
SysUtils, DCPsha256;
|
||||
|
||||
var
|
||||
ros: String;
|
||||
sha256 : TDCP_sha256;
|
||||
digest : array[0..63] of byte;
|
||||
i: Integer;
|
||||
output: String;
|
||||
begin
|
||||
ros := 'Rosetta code';
|
||||
|
||||
sha256 := TDCP_sha256.Create(nil);
|
||||
sha256.init;
|
||||
sha256.UpdateStr(ros);
|
||||
sha256.Final(digest);
|
||||
|
||||
output := '';
|
||||
|
||||
for i := 0 to 31 do begin
|
||||
output := output + intToHex(digest[i], 2);
|
||||
end;
|
||||
|
||||
writeln(lowerCase(output));
|
||||
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue