CRC
Cyclic Redundancy Code
This string function conducts a logical operation on the binary form of a string value, byte by byte, and returns a two-byte ASCII cyclic redundancy code. CRC provides some communication error checking on a given string value with the probability of uniqueness being 1 in 65536.
Syntax
Section titled “Syntax”CRC (string-value [,2-byte-string] [,ERR=line-ref|,ERC=error-code])string-value- is any string.
2-byte-string- is a two-byte string to be included in this CRC operation that is used to carry forward the result of a previous CRC operation.
line-ref- is the program line number or label to branch to if an error is produced by this function.
error-code- is a programmer-defined error code. Valid values are positive or negative whole numbers.
Remarks
Section titled “Remarks”This function is normally used in checking for errors in data transmission.
The logical operation of this function is a complex exclusive OR, in a predetermined pattern, on each bit in the binary form of the string-value.
This function is associative, allowing results to be accumulated for use in later CRC functions. For this capability, the optional 2-byte-string can be specified.
Examples
Section titled “Examples”CRC ("C")returns the characters “qA” or $F141$ which represent the result of the CRC operation.
LET A$ = CRC (B$+C$)is equivalent to:
LET A$ = CRC (B$)LET A$ = CRC (C$,A$)See also
Section titled “See also”LRC function
From the Thoroughbred Basic Language Reference, Volume I: A–E, version 8.9.1. Open this page in the PDF