Skip to main content

rotation_epoch

Function rotation_epoch 

Source
pub fn rotation_epoch(boot_id: u64, unix_secs: i64) -> RotationEpoch
Expand description

Compute the rotation epoch from a per-boot identifier and the current UTC time.

The peering doc requires the opaque advertisement to rotate at every boot and at least every 24 h. The epoch changes whenever boot_id changes (a new boot), and within one boot at every UTC-day boundary, so no advertised name outlives 24 h. A device re-advertises when the epoch it computes differs from the one it last advertised.