Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ cargo bench --bench encode

Licensed under either of

- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
<https://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or
<https://opensource.org/licenses/MIT>)
- Apache License, Version 2.0
([LICENSE-APACHE](https://github.com/cipherstash/base85-simd/blob/main/LICENSE-APACHE)
or <https://www.apache.org/licenses/LICENSE-2.0>)
- MIT license
([LICENSE-MIT](https://github.com/cipherstash/base85-simd/blob/main/LICENSE-MIT)
or <https://opensource.org/licenses/MIT>)

at your option.
34 changes: 1 addition & 33 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
//! Fast Base85 (RFC 1924 / Z85-style) encoding and decoding.
//!
//! On `aarch64` the encoder uses NEON intrinsics to process 16 input bytes
//! per iteration. On other architectures and on the decode path, a portable
//! scalar implementation is used. The output is byte-for-byte compatible
//! with the [`base85`](https://crates.io/crates/base85) crate.
//!
//! # Alphabet
//!
//! ```text
//! 0123456789
//! ABCDEFGHIJKLMNOPQRSTUVWXYZ
//! abcdefghijklmnopqrstuvwxyz
//! !#$%&()*+-;<=>?@^_`{|}~
//! ```
//!
//! # Tail handling
//!
//! Inputs whose length is not a multiple of 4 are encoded as
//! `floor(len / 4) * 5 + (len % 4) + 1` characters. The trailing partial
//! block is padded with zero bytes for encoding, and with the maximum digit
//! (`~` = 84) for decoding — the choice ensures the discarded low bytes
//! cannot perturb the kept high bytes.
//!
//! # Example
//!
//! ```
//! let data = b"hello, world!";
//! let encoded = base85_simd::encode(data);
//! let decoded = base85_simd::decode(&encoded).unwrap();
//! assert_eq!(decoded, data);
//! ```

#![doc = include_str!("../README.md")]
#![deny(unsafe_op_in_unsafe_fn)]
// Mission-critical lint config: production paths must not panic. Test code
// opts back in via `#[cfg_attr(test, allow(...))]` at the module level.
Expand Down
Loading