/// group_id calc for u8 status and u32 id
///
/// 32 bits prefix
///
/// 8 bits status and 24 bits id in big endian
#[inline(always)]
#[deprecated]
pub const fn g14(byte: u8, id: u32) -> u32 {
    let head = (byte as u32) << 24;
    let tail = id >> 8;
    head | tail
}

/// group_id calc for u32 id with specified bits prefix
#[inline(always)]
pub const fn g4bits(id: u32, bits: u32) -> u32 {
    let mask = !((1u32 << (u32::BITS - bits)) - 1);
    id & mask
}

/// group_id calc for u64 id with specified bits prefix
#[inline(always)]
pub const fn g8bits(id: u64, bits: u32) -> u32 {
    let id = (id >> 32) as u32;
    g4bits(id, bits)
}

/// group_id calc for u128 id with specified bits prefix
#[inline(always)]
pub const fn g16bits(id: u128, bits: u32) -> u32 {
    let id = (id >> 96) as u32;
    g4bits(id, bits)
}
