資源簡介
Linux中解壓后綴名tar.xz壓縮文件的工具 1
代碼片段和文件信息
///////////////////////////////////////////////////////////////////////////////
//
///?\file???????crc32.c
///?\brief??????Primitive?CRC32?calculation?tool
//
//??Author:?????Lasse?Collin
//
//??This?file?has?been?put?into?the?public?domain.
//??You?can?do?whatever?you?want?with?this?file.
//
///////////////////////////////////////////////////////////////////////////////
#include?“sysdefs.h“
#include?“l(fā)zma.h“
#include?
int
main(void)
{
uint32_t?crc?=?0;
do?{
uint8_t?buf[BUFSIZ];
const?size_t?size?=?fread(buf?1?sizeof(buf)?stdin);
crc?=?lzma_crc32(buf?size?crc);
}?while?(!ferror(stdin)?&&?!feof(stdin));
//printf(“%08“?PRIX32?“\n“?crc);
//?I?want?it?little?endian?so?it‘s?easy?to?work?with?hex?editor.
printf(“%02“?PRIX32?“?“?crc?&?0xFF);
printf(“%02“?PRIX32?“?“?(crc?>>?8)?&?0xFF);
printf(“%02“?PRIX32?“?“?(crc?>>?16)?&?0xFF);
printf(“%02“?PRIX32?“?“?crc?>>?24);
printf(“\n“);
return?0;
}
- 上一篇:一個STM32的USB鼠標例程
- 下一篇:云筆記系統(tǒng)設(shè)計源碼
評論
共有 條評論