2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 17:07:41 +00:00

Add Retro compliant CCRC32

This commit is contained in:
2015-08-17 12:26:47 -07:00
parent 387332ed70
commit 2b34c317e2
3 changed files with 77 additions and 1 deletions

15
Runtime/CCRC32.hpp Normal file
View File

@@ -0,0 +1,15 @@
#ifndef RETRO_CRC32_HPP
#define RETRO_CRC32_HPP
#include <cstdint>
class CCRC32
{
static const uint32_t crc32Table[256];
static inline uint32_t permute(uint32_t checksum, uint8_t b)
{ return (checksum >> 8) ^ crc32Table[(checksum & 0xFF) ^ b]; }
public:
static uint32_t Calculate(const void* data, uint32_t length);
};
#endif