DataBasic Reference > Statements and Intrinsic Functions > C > CRC Function

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

Reality V15.0 ()

CRC Function (DataBasic) (m618703+crc_f.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

CRC Function

Generates a Cyclic Redundancy Character (CRC).

Syntax

CRC(char-string{,type})

Syntax Elements

char-string is the data being sent or received expressed as a variable or symbol to which the data string has been assigned, or can be a literal string enclosed in quotes.

type specifies the type of polynomial used to generate the CRC.

1 = CRC-CCITT (X.25 Standard)

0 = CRC16

The default value is 0.

Operation

The CRC function generates a Cyclic Redundancy Character by performing a polynomial function against all the data bytes in the data string.

If type is 0 (or not specified), a sixteen bit CRC is generated using the CRC16 polynomial:

X16 + X15 + X2 + 1

If type is 1, a sixteen bit CRC is generated using the CRC-CCITT (X.25 Standard) polynomial (also known as the ADCCP polynomial):

X16 + X12 + X5 + 1

RealityV15.0Comment on this topic