MCPcopy Create free account
hub / github.com/EasyRPG/Player / crc32file

Function crc32file

src/meta.cpp:57–68  ·  view source on GitHub ↗

Helper: Get the CRC32 of a given file as a hex string

Source from the content-addressed store, hash-verified

55
56// Helper: Get the CRC32 of a given file as a hex string
57std::string crc32file(std::string file_name) {
58 if (!file_name.empty()) {
59 auto in = FileFinder::Game().OpenInputStream(file_name);
60 if (in) {
61 auto crc = Utils::CRC32(in);
62 std::stringstream res;
63 res <<std::hex << std::setfill('0') <<std::setw(8) <<crc;
64 return res.str();
65 }
66 }
67 return "";
68}
69
70
71Meta::Meta(std::string_view meta_file) {

Callers 2

IdentifyCanonNameMethod · 0.85

Calls 3

GameClass · 0.85
OpenInputStreamMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected