yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::cli::agent::tools::ProjectToolUtils Class Reference

Utility functions for checksums and serialization. More...

#include <project_tool.h>

Static Public Member Functions

static std::array< uint8_t, 32 > ComputeRomChecksum (const Rom *rom)
 Compute SHA-256 checksum of ROM data.
 
static std::array< uint8_t, 32 > ComputeSHA256 (const uint8_t *data, size_t length)
 Compute SHA-256 checksum of arbitrary data.
 
static std::string FormatChecksum (const std::array< uint8_t, 32 > &checksum)
 Format checksum as hex string.
 
static std::string FormatTimestamp (const std::chrono::system_clock::time_point &time)
 Format timestamp for display.
 
static absl::StatusOr< std::chrono::system_clock::time_point > ParseTimestamp (const std::string &timestamp)
 Parse timestamp from string.
 

Detailed Description

Utility functions for checksums and serialization.

Definition at line 181 of file project_tool.h.

Member Function Documentation

◆ ComputeRomChecksum()

std::array< uint8_t, 32 > yaze::cli::agent::tools::ProjectToolUtils::ComputeRomChecksum ( const Rom * rom)
static

Compute SHA-256 checksum of ROM data.

Parameters
romROM instance
Returns
32-byte SHA-256 hash

Definition at line 167 of file project_tool.cc.

References yaze::Rom::data(), yaze::Rom::is_loaded(), and yaze::Rom::size().

Referenced by yaze::cli::agent::tools::ProjectStatusTool::Execute(), yaze::cli::agent::tools::ProjectSnapshotTool::Execute(), and yaze::cli::agent::tools::ProjectManager::RestoreSnapshot().

Here is the call graph for this function:

◆ ComputeSHA256()

std::array< uint8_t, 32 > yaze::cli::agent::tools::ProjectToolUtils::ComputeSHA256 ( const uint8_t * data,
size_t length )
static

Compute SHA-256 checksum of arbitrary data.

Parameters
dataData buffer
lengthData length
Returns
32-byte SHA-256 hash

Definition at line 179 of file project_tool.cc.

◆ FormatChecksum()

std::string yaze::cli::agent::tools::ProjectToolUtils::FormatChecksum ( const std::array< uint8_t, 32 > & checksum)
static

Format checksum as hex string.

Parameters
checksum32-byte checksum
Returns
Hex string (64 characters)

Definition at line 184 of file project_tool.cc.

Referenced by yaze::cli::agent::tools::ProjectStatusTool::Execute(), yaze::cli::agent::tools::ProjectSnapshotTool::Execute(), and yaze::cli::agent::tools::ProjectToolBase::FormatSnapshot().

◆ FormatTimestamp()

std::string yaze::cli::agent::tools::ProjectToolUtils::FormatTimestamp ( const std::chrono::system_clock::time_point & time)
static

◆ ParseTimestamp()

absl::StatusOr< std::chrono::system_clock::time_point > yaze::cli::agent::tools::ProjectToolUtils::ParseTimestamp ( const std::string & timestamp)
static

Parse timestamp from string.

Parameters
timestampISO 8601 timestamp string
Returns
Time point

Definition at line 203 of file project_tool.cc.

Referenced by yaze::cli::agent::tools::ProjectSnapshot::LoadFromFile().


The documentation for this class was generated from the following files: