ipfrs_network/protocol_negotiator/
functions.rs1use super::types::ProtocolFeature;
6
7pub(super) fn all_known_features() -> [ProtocolFeature; 6] {
9 [
10 ProtocolFeature::Compression,
11 ProtocolFeature::Encryption,
12 ProtocolFeature::Multiplexing,
13 ProtocolFeature::PriorityQueuing,
14 ProtocolFeature::FlowControl,
15 ProtocolFeature::ArrowIpc,
16 ]
17}
18#[inline]
19pub(super) fn xorshift64(state: &mut u64) -> u64 {
20 let mut x = *state;
21 x ^= x << 13;
22 x ^= x >> 7;
23 x ^= x << 17;
24 *state = x;
25 x
26}
27#[inline]
28pub(super) fn fnv1a_64(data: &[u8]) -> u64 {
29 let mut h: u64 = 14695981039346656037;
30 for &b in data {
31 h ^= b as u64;
32 h = h.wrapping_mul(1099511628211);
33 }
34 h
35}