Skip to main content

Module base32

Module base32 

Source
Expand description

base32 encoding and decoding.

This module provides base32 encoding/decoding using a 32-character alphabet. Both padded and unpadded variants are available.

Constants§

PADDED
Padded base32 encoding (alias of STD).
RAW
Raw base32 encoding without padding.
STD
Standard base32 encoding with padding.

Functions§

decode
Decodes base32 encoded bytes with padding.
decode_len
Returns the decoded output length for padded input.
decode_mut
Decodes base32 encoded bytes into a mutable buffer with padding.
decode_n
Decodes a fixed-size base32 array with padding.
decode_raw
Decodes base32 encoded bytes without padding.
decode_raw_len
Returns the decoded output length for unpadded input.
decode_raw_mut
Decodes base32 encoded bytes into a mutable buffer without padding.
decode_raw_n
Decodes a fixed-size base32 array without padding.
decode_writer
Creates a decoding writer that wraps an io::Write.\n\nThe writer buffers base32 encoded bytes with padding, decodes them, and writes the raw output to the inner writer.\n\n# Examples\n\n\nuse omp_core::base32;\nuse std::io::Write;\n\nlet mut output = Vec::new();\nlet encoded = base32::encode(b\"Hello\").into_vec();\nlet mut writer = base32::decode_writer(&mut output);\nwriter.write_all(&encoded).unwrap();\nwriter.flush().unwrap();\nassert_eq!(output, b\"Hello\");\n\n
decode_writer_raw
Creates a decoding writer for unpadded base32.\n\nThe writer buffers base32 encoded bytes without padding, decodes them, and writes the raw output to the inner writer.\n\n# Examples\n\n\nuse omp_core::base32;\nuse std::io::Write;\n\nlet mut output = Vec::new();\nlet encoded = base32::encode_raw(b\"Hello\").into_vec();\nlet mut writer = base32::decode_writer_raw(&mut output);\nwriter.write_all(&encoded).unwrap();\nwriter.flush().unwrap();\nassert_eq!(output, b\"Hello\");\n\n
encode
Encodes a byte slice to base32 with padding.
encode_len
Returns the encoded length including padding.
encode_mut
Encodes bytes into a mutable buffer with padding.
encode_n
Encodes a fixed-size byte array to base32 with padding.
encode_raw
Encodes a byte slice to base32 without padding.
encode_raw_len
Returns the encoded length without padding.
encode_raw_mut
Encodes bytes into a mutable buffer without padding.
encode_raw_n
Encodes a fixed-size byte array to base32 without padding.
encode_writer
Creates an encoding writer that wraps an io::Write.\n\nThe writer buffers raw bytes, encodes them to base32 with padding, and writes the encoded output to the inner writer.\n\n# Examples\n\n\nuse omp_core::base32;\nuse std::io::Write;\n\nlet mut output = Vec::new();\nlet mut writer = base32::encode_writer(&mut output);\nwriter.write_all(b\"Hello\").unwrap();\nwriter.flush().unwrap();\n\n
encode_writer_raw
Creates an encoding writer for unpadded base32.\n\nThe writer buffers raw bytes, encodes them to base32 without padding, and writes the encoded output to the inner writer.\n\n# Examples\n\n\nuse omp_core::base32;\nuse std::io::Write;\n\nlet mut output = Vec::new();\nlet mut writer = base32::encode_writer_raw(&mut output);\nwriter.write_all(b\"Hello\").unwrap();\nwriter.flush().unwrap();\n\n

Type Aliases§

Decoder
Streaming decoder for base32-encoded data.
Encoder
Streaming encoder for base32 encoding.
Encoding
Encoding dictionary for base32.