From 0166f2d4dedd64f6298b3eef758229962ca18498 Mon Sep 17 00:00:00 2001 From: Mike Boensel Date: Wed, 18 Feb 2026 02:11:51 -0500 Subject: [PATCH] fix(token): update token generation to use rand::rng() to resolve deprecation warnings --- src/security/pairing.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/security/pairing.rs b/src/security/pairing.rs index 2a828e1..f7f34f5 100644 --- a/src/security/pairing.rs +++ b/src/security/pairing.rs @@ -176,14 +176,14 @@ fn generate_code() -> String { /// Generate a cryptographically-adequate bearer token with 256-bit entropy. /// -/// Uses `rand::thread_rng()` which is backed by the OS CSPRNG +/// Uses `rand::rng()` which is backed by the OS CSPRNG /// (/dev/urandom on Linux, BCryptGenRandom on Windows, SecRandomCopyBytes /// on macOS). The 32 random bytes (256 bits) are hex-encoded for a /// 64-character token, providing 256 bits of entropy. fn generate_token() -> String { use rand::RngCore; let mut bytes = [0u8; 32]; - rand::thread_rng().fill_bytes(&mut bytes); + rand::rng().fill_bytes(&mut bytes); format!("zc_{}", hex::encode(bytes)) }