Last change
on this file since 100 was 2, checked in by Rick van der Zwet, 15 years ago |
Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)
|
-
Property svn:executable
set to
*
|
File size:
752 bytes
|
Line | |
---|
1 | #include <stdio.h>
|
---|
2 | #include <stdlib.h>
|
---|
3 | #include <string.h>
|
---|
4 |
|
---|
5 | #include "lib_crc.h"
|
---|
6 |
|
---|
7 | #define MAX_STRING_SIZE 2048
|
---|
8 |
|
---|
9 |
|
---|
10 |
|
---|
11 | int main( int argc, char *argv[] ) {
|
---|
12 |
|
---|
13 | char input_string[MAX_STRING_SIZE];
|
---|
14 | char *ptr, *dest, hex_val;
|
---|
15 | unsigned long crc_32;
|
---|
16 | int a, ch, do_ascii, do_hex;
|
---|
17 | FILE *fp;
|
---|
18 |
|
---|
19 | do_ascii = TRUE;
|
---|
20 | ptr = "10101010";
|
---|
21 |
|
---|
22 |
|
---|
23 | crc_32 = 0xffffffffL;
|
---|
24 |
|
---|
25 | if ( do_ascii ) {
|
---|
26 | ptr = input_string;
|
---|
27 |
|
---|
28 | while ( *ptr ) {
|
---|
29 |
|
---|
30 | crc_32 = update_crc_32( crc_32, *ptr );
|
---|
31 |
|
---|
32 | ptr++;
|
---|
33 | }
|
---|
34 | }
|
---|
35 |
|
---|
36 |
|
---|
37 |
|
---|
38 | crc_32 ^= 0xffffffffL;
|
---|
39 |
|
---|
40 | printf("Uitvoer: %s", crc_32);
|
---|
41 |
|
---|
42 | } /* main (tst_crc.c) */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.