sdk-world
v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Toggle main menu visibility
Loading...
Searching...
No Matches
crc32.h
Go to the documentation of this file.
1
5
// //////////////////////////////////////////////////////////
6
// crc32.h
7
// Copyright (c) 2014,2015 Stephan Brumme. All rights reserved.
8
// see http://create.stephan-brumme.com/disclaimer.html
9
//
10
11
#pragma once
12
13
//#include "hash.h"
14
#include <string>
15
16
// define fixed size integer types
17
#ifdef _MSC_VER
18
// Windows
19
typedef
unsigned
__int8 uint8_t;
20
typedef
unsigned
__int32 uint32_t;
21
#else
22
// GCC
23
#include <stdint.h>
24
#endif
25
26
28
45
class
CRC32
//: public Hash
46
{
47
public
:
49
enum
{ HashBytes = 4 };
50
52
CRC32
();
53
55
std::string
operator()
(
const
void
* data,
size_t
numBytes);
57
std::string
operator()
(
const
std::string& text);
58
60
void
add
(
const
void
* data,
size_t
numBytes);
61
63
std::string
getHash
();
65
void
getHash
(
unsigned
char
buffer[HashBytes]);
66
68
void
reset
();
69
70
private
:
72
uint32_t m_hash;
73
};
CRC32::getHash
void getHash(unsigned char buffer[HashBytes])
return latest hash as bytes
CRC32::CRC32
CRC32()
same as reset()
Definition
crc32.cpp:18
CRC32::reset
void reset()
restart
Definition
crc32.cpp:25
CRC32::operator()
std::string operator()(const void *data, size_t numBytes)
compute CRC32 of a memory block
Definition
crc32.cpp:419
CRC32::add
void add(const void *data, size_t numBytes)
add arbitrary number of bytes
Definition
crc32.cpp:341
CRC32::getHash
std::string getHash()
return latest hash as 8 hex characters
Definition
crc32.cpp:385
hash
include
crc32.h
Generated by
1.18.0