Skip to main content

encode

Function encode 

Source
pub fn encode(wall_time_ms: i64, counter: i64) -> Result<i64, HlcError>
Expand description

Encodes physical milliseconds and a logical counter into one timestamp.

ยงErrors

Returns HlcError::InvalidComponent for a negative wall time or a counter outside 0..1000. Returns HlcError::ExceedsSafeInteger when the result is above MAX_ENCODED_TIMESTAMP.