CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
Host ID

Data Structures

struct  HostID
 Host identification information. More...
 

Typedefs

typedef struct HostID HostID
 Host identification information.
 

Functions

CX_C void hostId (HostID *id)
 

Detailed Description

Provides a stable, privacy-preserving host identifier that remains consistent across application runs on the same machine. The ID is generated by hashing platform-specific system identifiers (such as machine IDs, BIOS UUIDs, or configuration files) to create a 256-bit unique identifier.

The host ID is computed once per application run and cached. The implementation attempts multiple platform-specific identification methods in order of reliability:

The hashing approach ensures end-user privacy while maintaining stability.

Example:

HostID hid;
hostId(&hid);
// hid.id contains 256-bit unique identifier
// hid.source indicates which platform method was used
CX_C void hostId(HostID *id)
Host identification information.
Definition hostid.h:33

Function Documentation

◆ hostId()

CX_C void hostId ( HostID id)

void hostId(HostID *id)

Retrieves the stable host identifier for the current machine.

This function computes the host ID once on first call and caches it for subsequent calls. The identifier is stable across application runs on the same host but may change if underlying system identifiers change (e.g., hardware replacement, OS reinstall).

Parameters
idOutput parameter that receives the host identification