Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/CRC-32/Free-Pascal/crc-32.pas
Normal file
20
Task/CRC-32/Free-Pascal/crc-32.pas
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
Program CheckCRC;
|
||||
{$IFDEF fpc}{$mode Delphi}{$ENDIF}
|
||||
{$IFDEF WINDOWS}{$APPTYPE CONSOLE}{$ENDIF}
|
||||
uses
|
||||
sysutils,crc;
|
||||
|
||||
function CrcString(const mystring: string) : longword;
|
||||
var
|
||||
crcvalue: longword;
|
||||
begin
|
||||
crcvalue := crc32(0,nil,0);
|
||||
result := crc32(crcvalue, @mystring[1], length(mystring));
|
||||
end;
|
||||
|
||||
var
|
||||
mytext: string;
|
||||
begin
|
||||
myText := 'The quick brown fox jumps over the lazy dog';
|
||||
writeln('crc32 = ', IntToHex(CrcString(mytext), 8));
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue