ur is a crate to interact with "Uniform Resources (UR)" encodings
of binary data.
The encoding scheme is optimized for transport in URIs and QR codes.
The encoder allows a byte payload to be transmitted in
multiple stages, respecting maximum size requirements. Under the hood, a
fountain encoder is used to create an unbounded stream of URIs, subsets
of which can be recombined at the receiving side into the payload.
For example:
# use ;
# let mut encoder: = new;
# let mut decoder: = new;
const MAX_FRAGMENT_LENGTH: usize = 5;
let data = "Ten chars!".repeat;
encoder.start;
assert_eq!;
while !decoder.is_complete
assert_eq!;
The following useful building blocks are also part of the public API:
-
The [
bytewords] module contains functionality to encode byte payloads into a suitable alphabet, achieving hexadecimal byte-per-character efficiency. -
The
fountainmodule provides an implementation of a fountain encoder, which splits up a byte payload into multiple segments and emits an unbounded stream of parts which can be recombined at the receiving decoder side.