xz-5.2.3.tar.gz


Linux中解压后缀名tar.xz压缩文件的工具 1
资源截图
代码片段和文件信息
///////////////////////////////////////////////////////////////////////////////
//
/// file       crc32.c
/// rief      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 “lzma.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 “
“ 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(“
“);

return 0;
}

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)