Duckstation/src/util/cd_image_hasher.h

24 lines
785 B
C
Raw Normal View History

// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
2020-06-07 15:19:35 +00:00
#pragma once
#include "common/progress_callback.h"
#include "common/types.h"
2020-06-07 15:19:35 +00:00
#include <array>
#include <optional>
2020-06-07 15:19:35 +00:00
#include <string>
class CDImage;
namespace CDImageHasher {
using Hash = std::array<u8, 16>;
std::string HashToString(const Hash& hash);
std::optional<Hash> HashFromString(const std::string_view& str);
2020-06-07 15:19:35 +00:00
bool GetImageHash(CDImage* image, Hash* out_hash,
ProgressCallback* progress_callback = ProgressCallback::NullProgressCallback);
bool GetTrackHash(CDImage* image, u8 track, Hash* out_hash,
ProgressCallback* progress_callback = ProgressCallback::NullProgressCallback);
} // namespace CDImageHasher