CRC example to compute 32-bit CRC .

main.cpp

Committer:
deepikabhavnani
Date:
20 months ago
Revision:
2:a9d9b5c4a32b
Parent:
1:6f792125397a

File content as of revision 2:a9d9b5c4a32b:

#include "mbed.h"

int main()
{
    MbedCRC<POLY_32BIT_ANSI, 32> ct;

    char  test[] = "123456789";
    uint32_t crc = 0;
 
    printf("\nPolynomial = 0x%lx  Width = %d \n", ct.get_polynomial(), ct.get_width());
 
    ct.compute((void *)test, strlen((const char*)test), &crc);
    printf("The CRC of data \"123456789\" is : 0x%lx\n", crc);
    return 0;
 }