pub const fn fnv1a_hash(bytes: &[u8]) -> u64 {
let mut hash = 0xcbf29ce484222325u64; let mut i = 0;
while i < bytes.len() {
hash ^= bytes[i] as u64;
hash = hash.wrapping_mul(0x100000001b3u64); i += 1;
}
hash
}
pub const fn protocol_id(name: &str, version: u32) -> u64 {
let hash = fnv1a_hash(name.as_bytes());
(hash & 0xFFFFFFFF_FFFF0000) | (version as u64 & 0xFFFF)
}
pub trait ProtocolMetadata {
const PROTOCOL_ID: u64;
const PROTOCOL_NAME: &'static str;
const PROTOCOL_CRATE: &'static str;
const PROTOCOL_VERSION: u32;
}