bin-encrypt-decrypt

Crates.iobin-encrypt-decrypt
lib.rsbin-encrypt-decrypt
version2.2.1
sourcesrc
created_at2024-10-27 07:56:18.285016
updated_at2024-12-08 02:05:40.108509
descriptionA high-performance binary encryption and decryption library that supports customizable character sets beyond Base64.
homepage
repositoryhttps://github.com/ltpp-universe/bin-crypt-decrypt
max_upload_size
id1424396
size21,807
尤雨东 (ltpp-universe)

documentation

README

bin-encrypt-decrypt

Official Documentation

A high-performance binary encryption and decryption 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 encryption and decryption 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-encrypt-decrypt run cmd:

cargo add bin-encrypt-decrypt

Usage

Encrypt

Use Struct

use bin_encrypt_decrypt::*;
let mut crypt_decrypt: CryptDecrypt<'_> = CryptDecrypt::new();
let test_str: &str = "test";
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
crypt_decrypt.charset(&charset);
let encode: Result<String, CryptError> = crypt_decrypt.encrypt(test_str);

Use Function

use bin_encrypt_decrypt::*;
let test_str: &str = "test";
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
let encode: Result<String, CryptError> = encrypt(&charset, test_str);

Decrypt

Use Struct

use bin_encrypt_decrypt::*;
let mut crypt_decrypt: CryptDecrypt<'_> = CryptDecrypt::new();
let test_str: &str = "aab0aabLaabZaab0";
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
crypt_decrypt.charset(&charset);
let decode: Result<String, DecryptError> = crypt_decrypt.decrypt(test_str);

Use Function

use bin_encrypt_decrypt::*;
let test_str: &str = "aab0aabLaabZaab0";
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
let decode: Result<String, DecryptError> = decrypt(&charset, test_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 ltpp-universe root@ltpp.vip.

Commit count: 12

cargo fmt