crc over the string

the crc as result is initialized as zero, then each
byte is processed.
function StringCrc(s:shortstring):word;
var len,i:integer;
begin
result:=0;
len:=length(s);
for i:=1 to len do bytecrc(ord(s[i]),result);
end;

usage

The data is filled into a shortstring as :
crcstring:shortstring:=chr(data[1])+..+chr(data[N]);
MyCrc:word:=StringCrc(crcstring);

notes

This crc is calculated as X^16+X^15+X^2+1 and can
protect 2^16 bits or 8192 bytes against single bit
errors. For longer datablocks, the crc-32 is to be
used.
This the slow implementation requiring little RAM.
There also exists a fast implementation requiring
more RAM to hold a table. One byte is processed in
a few assembly instructions.