Skip to content

EntropyEngine::Networking::AssetId

Content-addressed asset identifier using SHA-256. More…

#include <AssetId.h>

Name
std::stringtoShortHex() const
Convert to shortened hex for logging (first 16 chars).
std::stringtoHex() const
Convert to hex string representation.
booloperator==(const AssetId & other) const
booloperator<(const AssetId & other) const
booloperator!=(const AssetId & other) const
AssetIdnull()
Create a null asset ID.
boolisValid() const
Check if this is a valid (non-null) asset ID.
boolisNull() const
Check if this is a null/invalid asset ID (all zeros).
AssetIdfromHex(const std::string & hex)
Create an AssetId from a hex string (64 characters).
AssetIdfromBytes(const uint8_t * data)
Create an AssetId from raw hash bytes.
Name
std::array< uint8_t, 32 >hash
SHA-256 hash (256-bit).
struct EntropyEngine::Networking::AssetId;

Content-addressed asset identifier using SHA-256.

AssetId is a 256-bit (32-byte) hash that uniquely identifies an asset by its content. Same content always produces the same AssetId, enabling:

  • Global uniqueness without central authority
  • Automatic deduplication of identical assets
  • Integrity verification (asset matches its ID)

Used for meshes, materials, textures, and any other asset type.

inline std::string toShortHex() const

Convert to shortened hex for logging (first 16 chars).

inline std::string toHex() const

Convert to hex string representation.

inline bool operator==(
const AssetId & other
) const
inline bool operator<(
const AssetId & other
) const
inline bool operator!=(
const AssetId & other
) const
static inline AssetId null()

Create a null asset ID.

inline bool isValid() const

Check if this is a valid (non-null) asset ID.

inline bool isNull() const

Check if this is a null/invalid asset ID (all zeros).

static inline AssetId fromHex(
const std::string & hex
)

Create an AssetId from a hex string (64 characters).

static inline AssetId fromBytes(
const uint8_t * data
)

Create an AssetId from raw hash bytes.

std::array< uint8_t, 32 > hash {};

SHA-256 hash (256-bit).


Updated on 2026-01-26 at 17:14:35 -0500