fix warnings

This commit is contained in:
Maple Nebel 2026-06-20 23:47:36 +02:00
commit 4e96a7a357

View file

@ -1,16 +1,13 @@
use hmac::{Hmac, KeyInit, Mac};
use md5::{
Md5,
digest::array::{Array, AsArrayRef},
};
use md5::Md5;
pub mod grpc;
pub type NEX_KEY = [u8; 16];
pub type NexKey = [u8; 16];
type HmacMd5 = Hmac<Md5>;
pub fn derive_pid_hmac(pid: u32, key: &NEX_KEY) -> [u8; 4] {
pub fn derive_pid_hmac(pid: u32, key: &NexKey) -> [u8; 4] {
let mut hmac = HmacMd5::new_from_slice(&key[..]).expect("infallible");
hmac.update(&pid.to_be_bytes());
hmac.finalize().as_bytes().as_slice()[0..4]