Add image verification
"Verify Dump" is now removed, now both hash calculation and image verification are done in one step. After a successful hash calculation, the button is replaced with a "Search on Redump.org" button that opens a web browser on Redump's search page.
This commit is contained in:
parent
e38ee512f3
commit
85ea9a629a
8 changed files with 311 additions and 54 deletions
|
|
@ -82,6 +82,17 @@ std::string HashToString(const Hash& hash)
|
|||
hash[9], hash[10], hash[11], hash[12], hash[13], hash[14], hash[15]);
|
||||
}
|
||||
|
||||
std::optional<Hash> HashFromString(const std::string_view& str) {
|
||||
auto decoded = StringUtil::DecodeHex(str);
|
||||
if (decoded && decoded->size() == std::tuple_size_v<Hash>)
|
||||
{
|
||||
Hash result;
|
||||
std::copy(decoded->begin(), decoded->end(), result.begin());
|
||||
return result;
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool GetImageHash(CDImage* image, Hash* out_hash,
|
||||
ProgressCallback* progress_callback /*= ProgressCallback::NullProgressCallback*/)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue