1 // SPDX-License-Identifier: 0BSD
3 ///////////////////////////////////////////////////////////////////////////////
6 /// \brief Primitive CRC32 calculation tool
8 // Author: Lasse Collin
10 ///////////////////////////////////////////////////////////////////////////////
24 const size_t size
= fread(buf
, 1, sizeof(buf
), stdin
);
25 crc
= lzma_crc32(buf
, size
, crc
);
26 } while (!ferror(stdin
) && !feof(stdin
));
28 //printf("%08" PRIX32 "\n", crc);
30 // I want it little endian so it's easy to work with hex editor.
31 printf("%02" PRIX32
" ", crc
& 0xFF);
32 printf("%02" PRIX32
" ", (crc
>> 8) & 0xFF);
33 printf("%02" PRIX32
" ", (crc
>> 16) & 0xFF);
34 printf("%02" PRIX32
" ", crc
>> 24);