basenc

Crates.iobasenc
lib.rsbasenc
version
sourcesrc
created_at2016-12-01 14:45:10.372738
updated_at2024-12-12 16:12:24.076317
descriptionEncoding and decoding of Base-N encodings, no_std compatible.
homepage
repositoryhttps://github.com/CasualX/basenc
max_upload_size
id7428
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Casper (CasualX)

documentation

https://docs.rs/basenc/

README

BaseNC

MIT License crates.io docs.rs Build status

Pronounced "Base-En-See".

Encoding and decoding hex, base64 and base32 with support for #[no_std].

Examples

Encoding:

let encoded = basenc::Base64Std.encode(b"hello world");
assert_eq!(encoded, "aGVsbG8gd29ybGQ");

Decoding:

let decoded = basenc::Base64Std.decode("aGVsbG8gd29ybGQ=").unwrap();
assert_eq!(decoded, b"hello world");

Features

  • std (default) - Enable support for the standard library. This enables convenience features to encode and decode to String and Vec<u8> buffers.

  • simd-off - Disable SIMD acceleration. The SIMD codepaths are less tested and are more likely to contain bugs.

  • simd-runtime - Enable runtime detection of SIMD support. This is enabled by default and will automatically use SIMD acceleration if available.

Build with RUSTFLAGS="-C target-cpu=native" (bash) / set RUSTFLAGS=-C target-cpu=native (cmd) to enable compiletime detection of SIMD capabilities.

Future work

Profile and optimize for performance.

Implement SIMD accelerated algorithms for encoding and decoding.

License

Licensed under MIT License, see license.txt.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.

Commit count: 6

cargo fmt