module

RNS::Rncp

Constants

APP_NAME = "rncp"
ERASE_STR = "\e[2K\r"

ANSI erase-to-start-of-line + carriage return

REQ_FETCH_NOT_ALLOWED = 240_u8
SPINNER_SYMS = "⢄⢂⢁⡁⡈⡐⡠"

Spinner characters matching Python's braille spinner.

Class methods

fetch(configdir : String | Nil, identitypath : String | Nil, verbosity : Int32, quietness : Int32, destination : String, file : String, timeout : Float64, silent : Bool, phy_rates : Bool, save : String | Nil, allow_overwrite : Bool)

Fetch mode — fetch a file from a remote rncp listener.

Source
format_progress(percent : Float64, current_size : String, total_size : String, speed_str : String, phy_str : String = "") : String

Format a transfer progress string.

Source
format_transfer_complete(percent : Float64, current_size : String, total_size : String, duration_str : String, speed_str : String, phy_str : String = "") : String

Format a transfer complete string.

Source
listen(configdir : String | Nil, identitypath : String | Nil, verbosity : Int32, quietness : Int32, allowed : Array(String), fetch_allowed : Bool, no_compress : Bool, jail : String | Nil, save : String | Nil, display_identity : Bool, disable_auth : Bool, announce : Int32, allow_overwrite : Bool)

Listen mode — receive files from authenticated senders.

Source
main(argv : Array(String) = ARGV.to_a)

Main entry point for the rncp binary.

Source
parse_args(argv : Array(String)) : Args

Parse command-line arguments matching Python argparse behavior.

Source
parse_destination_hash(hex : String) : Bytes

Validate a hex destination hash string, returning the bytes.

Source
prepare_identity(identity_path : String | Nil) : Identity

Prepare or load identity for rncp

Source
send(configdir : String | Nil, identitypath : String | Nil, verbosity : Int32, quietness : Int32, destination : String, file : String, timeout : Float64, silent : Bool, phy_rates : Bool, no_compress : Bool)

Send mode — send a file to a remote rncp listener.

Source
size_str(num : Float64 | Int32 | Int64 | UInt64, suffix : String = "B") : String

Size formatting matching Python's size_str exactly. suffix='B' for bytes, suffix='b' for bits (multiplies by 8).

Source
usage_string

Usage message matching Python argparse output.

Source
version_string

Version string matching Python's "rncp {version}" format.

Source

Nested types