Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

FletchPas

A unit Implementation of Fletcher's checksum in Delphi/FreePascal

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

FletchPas

A unit Implementation of Fletcher's checksum in Free Pascal

Usage

pascal
uses
  sysutils,
  // include the FletchPas unit
  FletchPas;

var
  bytes: array of Byte = (13, 56, 123); 
  checksum16: Word;
  checksum32: LongWord;
  checksum64: QWord;

begin
  checksum16 := Fletcher16(bytes);
  checksum32 := Fletcher32(bytes);
  checksum64 := Fletcher64(bytes);

  WriteLn(IntToHex(checksum16));
  WriteLn(IntToHex(checksum32));
  WriteLn(IntToHex(checksum64));    
  
// Output: 
// C012
// 00C00112
// 000000C000000112