correct CRC32, you must upgrade libfastcommon to V1.38 or later

pull/252/head
yuqing 2018-06-07 20:47:27 +08:00
parent 9757d08b18
commit af143b8d54
3 changed files with 5 additions and 4 deletions

View File

@ -1,9 +1,10 @@
Version 5.12 2018-05-23 Version 5.12 2018-06-07
* code refine for rare case * code refine for rare case
* replace print format OFF_PRINTF_FORMAT to PRId64 * replace print format OFF_PRINTF_FORMAT to PRId64
* php_ext fix zend_object_store_get_object call in php5.5 * php_ext fix zend_object_store_get_object call in php5.5
* make.sh uses macros define in /usr/include/fastcommon/_os_define.h * make.sh uses macros define in /usr/include/fastcommon/_os_define.h
* correct CRC32, you must upgrade libfastcommon to V1.38 or later
Version 5.11 2017-05-26 Version 5.11 2017-05-26
* bug fixed: file_offset has no effect when use trunk file * bug fixed: file_offset has no effect when use trunk file

View File

@ -24,7 +24,7 @@ int main(int argc, char *argv[])
int fd; int fd;
int read_bytes; int read_bytes;
int result; int result;
int crc32; int64_t crc32;
char buff[512 * 1024]; char buff[512 * 1024];
if (argc < 2) if (argc < 2)
@ -97,7 +97,7 @@ int main(int argc, char *argv[])
if (result == 0) if (result == 0)
{ {
crc32 = CRC32_FINAL(crc32); crc32 = CRC32_FINAL(crc32);
printf("%u\n", crc32); printf("%x\n", (int)crc32);
} }
return result; return result;

View File

@ -91,7 +91,7 @@ typedef struct
bool calc_file_hash; //if calculate file content hash code bool calc_file_hash; //if calculate file content hash code
int open_flags; //open file flags int open_flags; //open file flags
int file_hash_codes[4]; //file hash code int file_hash_codes[4]; //file hash code
int crc32; //file content crc32 signature int64_t crc32; //file content crc32 signature
MD5_CTX md5_context; MD5_CTX md5_context;
union union