Module utils

Module utils 

Source
Expand description

Utility functions and helpers for AmateRS

Common utility functions used across the codebase.

Functionsยง

align_to
Align value to alignment boundary
calculate_checksum
Calculate checksum for data
current_timestamp_micros
Get current timestamp in microseconds since UNIX epoch
current_timestamp_millis
Get current timestamp in milliseconds since UNIX epoch
exponential_backoff
Calculate exponential backoff delay
format_bytes
Format bytes as human-readable string
format_duration
Format duration as human-readable string
is_power_of_two
Check if a number is power of 2
linear_backoff
Calculate linear backoff delay
next_power_of_two
Round up to next power of 2
retry_with_backoff
Retry a function with exponential backoff
verify_checksum
Verify checksum