Skip to content

Instantly share code, notes, and snippets.

@prof7bit
Created July 30, 2014 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prof7bit/024648a550ab04cdb31f to your computer and use it in GitHub Desktop.
Save prof7bit/024648a550ab04cdb31f to your computer and use it in GitHub Desktop.
procedure CRC16_Xmodem_Update(var CRC: Word; Data: Byte);
var
I: Integer;
begin
CRC := CRC xor (Word(Data) shl 8);
for I := 0 to 7 do begin
if (CRC and $8000) <> 0 then
CRC := (CRC shl 1) xor $1021
else
CRC := CRC shl 1;
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment