Objective-C
Objective-C
Example: Crypt2.CrcBd method
Demonstrates how to call the CrcBd method.Chilkat Objective-C Downloads
#import <CkoCrypt2.h>
#import <CkoBinData.h>
CkoCrypt2 *crypt = [[CkoCrypt2 alloc] init];
CkoBinData *bd = [[CkoBinData alloc] init];
[bd AppendString: @"123456789" charset: @"us-ascii"];
unsigned long crc32 = [crypt CrcBd: @"crc-32" bd: bd];
// The decimal value is 3421780262 (converted to hex is 0xCBF43926)
NSLog(@"%d",crc32);
unsigned long crc8 = [crypt CrcBd: @"crc8" bd: bd];
NSLog(@"%d",crc8);