feat: do incremental calculation of CF's hash
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
f95bcf45ad
commit
b1763353ea
@ -75,14 +75,13 @@ QString EnsureMetadataTask::getHash(Mod* mod)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ModPlatform::Provider::FLAME: {
|
case ModPlatform::Provider::FLAME: {
|
||||||
QByteArray jar_data_treated;
|
auto should_filter_out = [](char c) {
|
||||||
for (char c : jar_data) {
|
|
||||||
// CF-specific
|
// CF-specific
|
||||||
if (!(c == 9 || c == 10 || c == 13 || c == 32))
|
return (c == 9 || c == 10 || c == 13 || c == 32);
|
||||||
jar_data_treated.push_back(c);
|
};
|
||||||
}
|
|
||||||
|
|
||||||
return QString::number(MurmurHash2(jar_data_treated, jar_data_treated.length()));
|
std::ifstream file_stream(mod->fileinfo().absoluteFilePath().toStdString(), std::ifstream::binary);
|
||||||
|
result = QString::number(MurmurHash2(std::move(file_stream), 4096, should_filter_out));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user