yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
rom_hash.h
Go to the documentation of this file.
1#ifndef YAZE_UTIL_ROM_HASH_H
2#define YAZE_UTIL_ROM_HASH_H
3
4#include <cstddef>
5#include <cstdint>
6#include <string>
7#include <string_view>
8
9namespace yaze::util {
10
11// Standard IEEE CRC32; new identities always use this algorithm.
12uint32_t CalculateCrc32(const uint8_t* data, size_t size);
13std::string ComputeRomHash(const uint8_t* data, size_t size);
14
16
17// Hashes of one loaded-ROM identity, captured before pending edits. The legacy
18// value exists only to verify old untagged project hashes, never to mint new ones.
20 std::string crc32;
21 std::string legacy_crc32;
22 std::string sha1;
23
24 RomHashMatch Match(std::string_view expected) const;
25};
26RomIdentityHashes ComputeRomIdentityHashes(const uint8_t* data, size_t size);
27
29std::string ComputeSha1Hex(const uint8_t* data, size_t size);
30
33std::string ComputeFileSha1Hex(const std::string& path);
34
35} // namespace yaze::util
36
37#endif // YAZE_UTIL_ROM_HASH_H
RomIdentityHashes ComputeRomIdentityHashes(const uint8_t *data, size_t size)
Definition rom_hash.cc:84
std::string ComputeSha1Hex(const uint8_t *data, size_t size)
Compute SHA-1 hash of data, return lowercase hex string (40 chars).
Definition rom_hash.cc:234
std::string ComputeFileSha1Hex(const std::string &path)
Definition rom_hash.cc:251
uint32_t CalculateCrc32(const uint8_t *data, size_t size)
Definition rom_hash.cc:76
std::string ComputeRomHash(const uint8_t *data, size_t size)
Definition rom_hash.cc:80
RomHashMatch Match(std::string_view expected) const
Definition rom_hash.cc:90