Initial commit: Veritas Suite Main Server and Core Engine

This commit is contained in:
2026-07-28 20:42:29 +02:00
commit 542bc6471b
18 changed files with 2890 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
use sha2::{Digest, Sha256};
/// Computes a unique hardware fingerprint (CPU / Machine identifier).
pub fn generate_hardware_id() -> String {
let mut hasher = Sha256::new();
let hostname = std::env::var("COMPUTERNAME")
.or_else(|_| std::env::var("HOSTNAME"))
.unwrap_or_else(|_| "UNKNOWN-HOST".to_string());
let username = std::env::var("USERNAME")
.or_else(|_| std::env::var("USER"))
.unwrap_or_else(|_| "UNKNOWN-USER".to_string());
let raw_id = format!("{}:{}", hostname, username);
hasher.update(raw_id.as_bytes());
format!("{:x}", hasher.finalize())
}