EntropyEngine::Networking::AssetId
EntropyEngine::Networking::AssetId
Section titled “EntropyEngine::Networking::AssetId”Content-addressed asset identifier using SHA-256. More…
#include <AssetId.h>
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| std::string | toShortHex() const Convert to shortened hex for logging (first 16 chars). |
| std::string | toHex() const Convert to hex string representation. |
| bool | operator==(const AssetId & other) const |
| bool | operator<(const AssetId & other) const |
| bool | operator!=(const AssetId & other) const |
| AssetId | null() Create a null asset ID. |
| bool | isValid() const Check if this is a valid (non-null) asset ID. |
| bool | isNull() const Check if this is a null/invalid asset ID (all zeros). |
| AssetId | fromHex(const std::string & hex) Create an AssetId from a hex string (64 characters). |
| AssetId | fromBytes(const uint8_t * data) Create an AssetId from raw hash bytes. |
Public Attributes
Section titled “Public Attributes”| Name | |
|---|---|
| std::array< uint8_t, 32 > | hash SHA-256 hash (256-bit). |
Detailed Description
Section titled “Detailed Description”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.
Public Functions Documentation
Section titled “Public Functions Documentation”function toShortHex
Section titled “function toShortHex”inline std::string toShortHex() constConvert to shortened hex for logging (first 16 chars).
function toHex
Section titled “function toHex”inline std::string toHex() constConvert to hex string representation.
function operator==
Section titled “function operator==”inline bool operator==( const AssetId & other) constfunction operator<
Section titled “function operator<”inline bool operator<( const AssetId & other) constfunction operator!=
Section titled “function operator!=”inline bool operator!=( const AssetId & other) constfunction null
Section titled “function null”static inline AssetId null()Create a null asset ID.
function isValid
Section titled “function isValid”inline bool isValid() constCheck if this is a valid (non-null) asset ID.
function isNull
Section titled “function isNull”inline bool isNull() constCheck if this is a null/invalid asset ID (all zeros).
function fromHex
Section titled “function fromHex”static inline AssetId fromHex( const std::string & hex)Create an AssetId from a hex string (64 characters).
function fromBytes
Section titled “function fromBytes”static inline AssetId fromBytes( const uint8_t * data)Create an AssetId from raw hash bytes.
Public Attributes Documentation
Section titled “Public Attributes Documentation”variable hash
Section titled “variable hash”std::array< uint8_t, 32 > hash {};SHA-256 hash (256-bit).
Updated on 2026-01-26 at 17:14:35 -0500