11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ExamplesThe $ZCRC function in this example returns the byte sum of 131.$ZCYCWRITE $ZCRC("AB",0)The checksum is derived as follows:WRITE $ASCII("A")+$ASCII("B")= 65+66 = 131See Also• $ZCYC function$ZCYCCyclical-redundancy check for data integrity.$ZCYC(string)$ZC(string)ParametersstringA string.Description$ZCYC(string) computes and returns the cyclical-redundancy check value for the string. Itallows two inter-communicating programs to check for data integrity.The sending program transmits a piece of data along with a matching check value that itcalculates using $ZCYC. The receiving program verifies the transmitted data by using $ZCYCto calculate its check value. If the two check values match, the received data is the same asthe sent data.$ZCYC calculates the check value by performing an exclusive OR (XOR) on the binaryrepresentations of all the characters in the string.Use caution when transmitting data between 8-bit and UNICODE (16-bit) implementationsof <strong>Caché</strong>; if a data string does not contain any wide characters, the cyclical-redundancy checkvalues should match.<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 527

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!