1 /* contrib/ltree/crc32.c */
4 * Implements CRC-32, as used in ltree.
6 * Note that the CRC is used in the on-disk format of GiST indexes, so we
7 * must stay backwards-compatible!
15 #define TOLOWER(x) tolower((unsigned char) (x))
17 #define TOLOWER(x) (x)
21 #include "utils/pg_crc.h"
24 ltree_crc32_sz(const char *buf
, int size
)
29 INIT_TRADITIONAL_CRC32(crc
);
32 char c
= (char) TOLOWER(*p
);
34 COMP_TRADITIONAL_CRC32(crc
, &c
, 1);
38 FIN_TRADITIONAL_CRC32(crc
);
39 return (unsigned int) crc
;