Skip to content

Commit d5cc32b

Browse files
committed
docs(base32): clarify fast_encode_stream and fix spelling
1 parent f1f4973 commit d5cc32b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/uu/base32/src/base_common.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pub fn handle_input<R: Read>(input: &mut R, format: Format, config: Config) -> U
173173
let mut stdout_lock = io::stdout().lock();
174174
let result = match (format, config.decode) {
175175
// Base58 must process the entire input as one big integer; keep the
176-
// historical behaviour of buffering everything for this format only.
176+
// historical behavior of buffering everything for this format only.
177177
(Format::Base58, _) => {
178178
let mut buffered = Vec::new();
179179
input
@@ -511,6 +511,18 @@ pub mod fast_encode {
511511
Ok(())
512512
}
513513

514+
/// Encodes all data read from `input` into Base32 using a fast, chunked
515+
/// implementation and writes the result to `output`.
516+
///
517+
/// The `supports_fast_decode_and_encode` parameter supplies an optimized
518+
/// encoder and determines the chunk size used for bulk processing. When
519+
/// `wrap` is:
520+
/// - `Some(0)`: no line wrapping is performed,
521+
/// - `Some(n)`: lines are wrapped every `n` characters,
522+
/// - `None`: the default wrap width is applied.
523+
///
524+
/// Remaining bytes are encoded and flushed at the end. I/O or encoding
525+
/// failures are propagated via `UResult`.
514526
pub fn fast_encode_stream(
515527
input: &mut dyn Read,
516528
output: &mut dyn Write,

0 commit comments

Comments
 (0)