Expand description
Common shared utilities used across download, upload, formatting, and progress modules.
This module consolidates duplicated functionality to follow DRY principles:
- Bandwidth calculation
- Stream count determination
- Distance formatting
- Data size formatting
Functionsยง
- bar_
chart - Render a horizontal bar chart using Unicode block characters.
- calculate_
bandwidth - Calculate bandwidth in bits per second from bytes transferred and elapsed time.
- determine_
stream_ count - Determine number of concurrent streams based on single connection flag.
- format_
data_ size - Format byte count into a human-readable string (KB, MB, GB).
- format_
distance - Format distance consistently: 1 decimal for < 100 km, 0 decimals for >= 100 km.
- is_
valid_ ipv4 - Validate an IPv4 address string.