pub fn key_to_value2(index: u64) -> Option<u64> {
    if index < 100 {
        Some(index)
    } else if index < 200 {
        Some(100 + (index - 99) * 10 - 1)
    } else if index < 300 {
        Some((index - 200) * 100 + 1099)
    } else if index < 400 {
        Some((index - 300) * 10_000_000)
    } else if index < 500 {
        Some((index - 399) * 1_000_000_000)
    } else if index < 600 {
        Some((index - 499) * 100_000_000_000)
    } else {
        None
    }
}
// reverse indexing for use in userspace
reverse indexing for use in userspace
reverse indexing for use in userspace
pub fn key_to_value2(index: u64) -> Option<u64> {
    if index < 100 {
        Some(index)
    } else if index < 200 {
        Some(100 + (index - 99) * 10 - 1)
    } else if index < 300 {
        Some((index - 200) * 100 + 1099)
    } else if index < 400 {
        Some((index - 300) * 10_000_000)
    } else if index < 500 {
        Some((index - 399) * 1_000_000_000)
    } else if index < 600 {
        Some((index - 499) * 100_000_000_000)
    } else {
        None
    }
}
pub fn key_to_value2 ( index : u64 ) -> Option < u64 > { if index < 100 { Some ( index ) } else if index < 200 { Some ( 100 + ( index - 99 ) * 10 - 1 ) } else if index < 300 { Some ( ( index - 200 ) * 100 + 1099 ) } else if index < 400 { Some ( ( index - 300 ) * 10_000_000 ) } else if index < 500 { Some ( ( index - 399 ) * 1_000_000_000 ) } else if index < 600 { Some ( ( index - 499 ) * 100_000_000_000 ) } else { None } }
reverse indexing for use in userspace
reverse indexing for use in userspace
index
u64
index
u64