Crate lipmaa_link

Crate lipmaa_link 

Source
Expand description

A function to calculate lipmaa sequence numbers.

From the bamboo spec: “The lipmaalinks are chosen such that for any pair of entries there is a path from the newer to the older one of a length logarithmic in their distance.”

use lipmaa_link::lipmaa;

let result = lipmaa(13);
assert_eq!(result, 4);

Constants§

MAX_NUM_LIPMAA_LINKS_FOR_U64
The number of lipmaa links needed to traverse from u64::MAX back to 0;

Functions§

get_lipmaa_links_back_to
Get all the lipmaa link numbers back to some other lipmaa_link in descending order
get_lipmaa_links_back_to_root
Get all the lipmaa link numbers between n and 0
is_skip_link
Will n create a “skip” link rather than just n - 1
lipmaa
Calculates the lipmaa link number given the current sequence number.