|
1 | 1 | /*-------------------------------------------------------------------------
|
2 | 2 | *
|
3 |
| - * pg_crc_tables.h |
4 |
| - * Polynomial lookup tables for CRC macros |
5 |
| - * |
6 |
| - * We make these tables available as a .h file so that programs not linked |
7 |
| - * with libpgport can still use the macros in pg_crc.h. They just need |
8 |
| - * to #include this header as well. |
| 3 | + * pg_crc.c |
| 4 | + * PostgreSQL CRC support |
9 | 5 | *
|
10 | 6 | * See Ross Williams' excellent introduction
|
11 | 7 | * A PAINLESS GUIDE TO CRC ERROR DETECTION ALGORITHMS, available from
|
12 | 8 | * http://www.ross.net/crc/download/crc_v3.txt or several other net sites.
|
13 | 9 | *
|
14 |
| - * These lookup tables are for normal, not "reflected", in Williams' terms, |
15 |
| - * CRC. |
16 |
| - * |
17 | 10 | * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
|
18 | 11 | * Portions Copyright (c) 1994, Regents of the University of California
|
19 | 12 | *
|
20 |
| - * src/include/utils/pg_crc_tables.h |
| 13 | + * |
| 14 | + * IDENTIFICATION |
| 15 | + * src/common/pg_crc.c |
21 | 16 | *
|
22 | 17 | *-------------------------------------------------------------------------
|
23 | 18 | */
|
24 |
| -#ifndef PG_CRC_TABLES_H |
25 |
| -#define PG_CRC_TABLES_H |
| 19 | + |
| 20 | +#include "c.h" |
26 | 21 |
|
27 | 22 | /*
|
28 | 23 | * This table is based on the so-called Castagnoli polynomial (the same
|
29 |
| - * that is used e.g. in iSCSI). |
| 24 | + * that is used e.g. in iSCSI). It is for normal, not "reflected", in |
| 25 | + * Williams' terms, CRC. |
30 | 26 | */
|
31 | 27 | const uint32 pg_crc32c_table[256] = {
|
32 | 28 | 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4,
|
@@ -100,6 +96,7 @@ const uint32 pg_crc32c_table[256] = {
|
100 | 96 | * This table is based on the polynomial
|
101 | 97 | * x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
|
102 | 98 | * (This is the same polynomial used in Ethernet checksums, for instance.)
|
| 99 | + * It is for normal, not "reflected", in Williams' terms, CRC. |
103 | 100 | */
|
104 | 101 | const uint32 pg_crc32_table[256] = {
|
105 | 102 | 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
|
@@ -167,5 +164,3 @@ const uint32 pg_crc32_table[256] = {
|
167 | 164 | 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
|
168 | 165 | 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
|
169 | 166 | };
|
170 |
| - |
171 |
| -#endif /* PG_CRC_TABLES_H */ |
0 commit comments