#base64 #character-set #decode #high-performance #base64alternative #customcharset #binaryencode

bin-encode-decode

A high-performance binary encode and decode library that supports customizable character sets beyond Base64

14 releases (3 stable)

Uses new Rust 2024

new 1.0.2 Jul 5, 2025
1.0.1 May 24, 2025
0.2.4 May 20, 2025
0.2.0 Apr 13, 2025
0.0.1 Feb 20, 2025

#1288 in Encoding

Download history 352/week @ 2025-03-19 45/week @ 2025-03-26 5/week @ 2025-04-02 103/week @ 2025-04-09 20/week @ 2025-04-16 104/week @ 2025-04-30 21/week @ 2025-05-07 166/week @ 2025-05-14 551/week @ 2025-05-21 303/week @ 2025-05-28 197/week @ 2025-06-04 128/week @ 2025-06-11 103/week @ 2025-06-18 77/week @ 2025-06-25 157/week @ 2025-07-02

486 downloads per month
Used in 3 crates (2 directly)

MIT license

16KB
217 lines

bin-encode-decode

Official Documentation

A high-performance binary encode and decode library that supports customizable character sets beyond Base64.

Features

  • Custom Character Sets: Define your own character set for encoding and decoding, allowing for flexible data representation.
  • High Performance: Optimized for speed, making it suitable for applications requiring efficient cryptographic operations.
  • Simple API: Intuitive and easy-to-use interface for both encode and decode processes.
  • Robust Error Handling: Provides clear and descriptive error messages to facilitate debugging.
  • Extensive Documentation: Comprehensive guides and examples to help you get started quickly.

Installation

To install bin-encode-decode run cmd:

cargo add bin-encode-decode

Usage

encode

Use Struct

use bin_encode_decode::*;

let mut en_decode: Charset<'_> = Charset::new();
let test_str: &str = "test";
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
en_decode.charset(&charset);
let encode: Result<String, EncodeError> = en_decode.encode(test_str);

Use Function

use bin_encode_decode::*;

let test_str: &str = "test";
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
let encode: Result<String, EncodeError> = Encode::execute(&charset, test_str);

decode

Use Struct

use bin_encode_decode::*;

let mut en_decode: Charset<'_> = Charset::new();
let test_str: &str = "aab0aabLaabZaab0";
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
en_decode.charset(&charset);
let decode: Result<String, DecodeError> = en_decode.decode(test_str);

Use Function

use bin_encode_decode::*;

let charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=";
let encoded_str = "aab0aabLaabZaab0";
let decoded_str = Decode::execute(charset, encoded_str);
let charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=";
let original_str = "test";
let encoded_str = Encode::execute(charset, original_str);

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Contact

For any inquiries, please reach out to the author at root@ltpp.vip.

No runtime deps