Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
stenzek
GitHub Repository: stenzek/duckstation
Path: blob/master/src/util/cd_image_hasher.h
4212 views
1
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <[email protected]>
2
// SPDX-License-Identifier: CC-BY-NC-ND-4.0
3
4
#pragma once
5
#include "common/progress_callback.h"
6
#include "common/types.h"
7
#include <array>
8
#include <optional>
9
#include <string>
10
11
class CDImage;
12
13
namespace CDImageHasher {
14
15
using Hash = std::array<u8, 16>;
16
std::string HashToString(const Hash& hash);
17
std::optional<Hash> HashFromString(std::string_view str);
18
19
bool GetImageHash(CDImage* image, Hash* out_hash,
20
ProgressCallback* progress_callback = ProgressCallback::NullProgressCallback);
21
bool GetTrackHash(CDImage* image, u8 track, Hash* out_hash,
22
ProgressCallback* progress_callback = ProgressCallback::NullProgressCallback);
23
24
} // namespace CDImageHasher
25