Skip to content

Commit

Permalink
display hash at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
jube committed Feb 14, 2025
1 parent 8ec60a0 commit 911adbf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion code/bits/WorldData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,20 @@ namespace akgr {
void WorldData::save_to_file(const std::filesystem::path& filename) const
{
gf::FileOutputStream file(filename);
gf::CompressedOutputStream compressed(&file);
gf::HashedOutputStream hashed(&file);
gf::CompressedOutputStream compressed(&hashed);
gf::Serializer ar(&compressed, DataVersion);

ar | *this;

auto hash = hashed.hash();
std::string digest;

for (auto byte : hash) {
digest += fmt::format("{:02X}", byte);
}

gf::Log::info("Hash: {}", digest);
}

void WorldData::bind()
Expand Down

0 comments on commit 911adbf

Please sign in to comment.