duckstation

duckstation, but archived from the revision just before upstream changed it to a proprietary software project, this version is the libre one
git clone https://git.neptards.moe/u3shit/duckstation.git
Log | Files | Refs | README | LICENSE

cd_image_hasher.h (778B)


      1 // SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
      2 // SPDX-License-Identifier: (GPL-3.0 OR 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