use crate::key_composer::{KeyComposer, KeyTag, SmallKey};
#[inline]
pub fn bloom_meta(kc: &KeyComposer<'_>, key: &[u8]) -> SmallKey {
kc.compose_meta_key_stack(KeyTag::BloomMeta.as_slice(), key)
}
#[inline]
pub fn bloom_item(kc: &KeyComposer<'_>, key: &[u8], filter_idx: u16) -> SmallKey {
kc.compose_subkey_stack(KeyTag::BloomData.as_slice(), key, &filter_idx.to_be_bytes())
}
#[inline]
pub fn bloom_prefix(kc: &KeyComposer<'_>, key: &[u8]) -> Vec<u8> {
kc.compose_prefix(KeyTag::BloomData.as_slice(), key)
}
#[inline]
pub fn bloom_prefix_stack(kc: &KeyComposer<'_>, key: &[u8]) -> SmallKey {
kc.compose_prefix_stack(KeyTag::BloomData.as_slice(), key)
}
#[inline]
pub fn cuckoo_meta(kc: &KeyComposer<'_>, key: &[u8]) -> SmallKey {
kc.compose_meta_key_stack(KeyTag::CuckooMeta.as_slice(), key)
}
#[inline]
pub fn cuckoo_page(kc: &KeyComposer<'_>, key: &[u8], filter_idx: u16, page_idx: u32) -> SmallKey {
kc.compose_subkey2_stack(
KeyTag::CuckooData.as_slice(),
key,
&filter_idx.to_be_bytes(),
&page_idx.to_be_bytes(),
)
}
#[inline]
pub fn cuckoo_prefix(kc: &KeyComposer<'_>, key: &[u8]) -> Vec<u8> {
kc.compose_prefix(KeyTag::CuckooData.as_slice(), key)
}
#[inline]
pub fn cuckoo_prefix_stack(kc: &KeyComposer<'_>, key: &[u8]) -> SmallKey {
kc.compose_prefix_stack(KeyTag::CuckooData.as_slice(), key)
}