Function select_lifetime

Source
fn select_lifetime<Rng: RngCore>(
    rng: &mut Rng,
    min_lifetime: Duration,
    max_lifetime: Duration,
) -> Result<Duration, VanguardMgrError>
Available on crate feature vanguards only.
Expand description

Randomly select the lifetime of a vanguard from the max(X,X) distribution, where X is a uniform random value between min_lifetime and max_lifetime.

This ensures we are biased towards longer lifetimes.

See https://spec.torproject.org/vanguards-spec/vanguards-stats.html