EasyManuals Logo

VeriFone MX800 Series User Manual

VeriFone MX800 Series
344 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #144 background imageLoading...
Page #144 background image
SERVICE FUNCTIONS
svcCrcCalc()
144 M
X
800 SERIES PROGRAMMERS GUIDE
svcCrcCalc()
Prototype
checksum = svcCrcCalc(type, buffer, size)
int checksum, type, size;
char*buffer;
Parameters
This routine returns the cyclic redundancy check for a string contained in buffer
of a length specified by size. Each type is now specified by referring to a
standard CRC description model which can be found by searching the Internet for
“A Painless Guide to CRC Error Detection Algorithms” (August 1993) by Ross N.
Williams.
The model has the following description parameters: width (of CRC/LRC in bits),
poly(nomial), (init)ialization value generally 0 or -1, refin (whether each input byte
is reflected about its center before being applied to the algorithm), refot (whether
the calculated CRC gets reflected about its center), xorot (the value generally 0 or
-1 that gets exclusive-ored to the final result before being returned to the caller,
check (the CRC/LRC produced by applying this algorithm to the 9-character ascii
string “0123456789”.
The type parameter specifies what type of calculation is to be employed:
0 Longitudinal Redundancy Check. This is simply the exclusive OR'ing of all
bytes in the string. The result of the LRC will be stored in the lower byte. The
upper byte will be set to zero.
Model: width=8,poly=0x01,init=0,refin=0,refot=0,xorot=0,check=0x31.
1 Cyclic Redundancy Check, based on the standard CRC16 polynomial,
X^16+X^15+X^2+1. Bits are read least-significant-bit first, as is traditional in
hardware implementations. The CRC1 value is returned in the low byte and
the CRC2 value is returned in the high byte.
Model: width=16,poly=0xA001,init=0,refin=0,refot=0,xorot=0,check=0xA47b
2 CRC16, most-significant-bit first, as is often used in software implementations.
The CRC1 value is returned in the high byte and the CRC2 value is returned in
the low byte.
Model: width=16,poly=0x8005,init=0,refin=0,refot=0,xorot=0,check=0xFEE8
3 CCITT polynomial, X^16+X^12+X^5+1, lsb-first
Model: width=16,poly=0x8408,init=-1,refin=0,refot=0,xorot=0,check=0x0520
4 CCITT, msb-first
Model: width=16,poly=0x1021,init=-1,refin=0,refot=0,xorot=0,check=0x29B1

Table of Contents

Other manuals for VeriFone MX800 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the VeriFone MX800 Series and is the answer not in the manual?

VeriFone MX800 Series Specifications

General IconGeneral
BrandVeriFone
ModelMX800 Series
CategoryTouch terminals
LanguageEnglish

Related product manuals