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