|
1 | 1 | <center> |
2 | 2 |
|
3 | | -# bin-encrypt-decrypt |
| 3 | +# bin-encode-decode |
4 | 4 |
|
5 | | -[](https://crates.io/crates/bin-encrypt-decrypt) |
6 | | -[](https://docs.rs/bin-encrypt-decrypt) |
7 | | -[](https://github.com/ltpp-universe/bin-encrypt-decrypt/actions?query=workflow:Rust) |
8 | | -[](./LICENSE) |
| 5 | +[](https://crates.io/crates/bin-encode-decode) |
| 6 | +[](https://docs.rs/bin-encode-decode) |
| 7 | +[](https://github.com/ltpp-universe/bin-encode-decode/actions?query=workflow:Rust) |
| 8 | +[](./LICENSE) |
9 | 9 |
|
10 | 10 | </center> |
11 | 11 |
|
12 | | -[Official Documentation](https://docs.ltpp.vip/BIN-ENCRYPT-DECRYPT/) |
| 12 | +[Official Documentation](https://docs.ltpp.vip/bin-encode-decode/) |
13 | 13 |
|
14 | | -A high-performance binary encryption and decryption library that supports customizable character sets beyond Base64. |
| 14 | +A high-performance binary encode and decode library that supports customizable character sets beyond Base64. |
15 | 15 |
|
16 | 16 | ## Features |
17 | 17 |
|
18 | 18 | - **Custom Character Sets**: Define your own character set for encoding and decoding, allowing for flexible data representation. |
19 | 19 | - **High Performance**: Optimized for speed, making it suitable for applications requiring efficient cryptographic operations. |
20 | | -- **Simple API**: Intuitive and easy-to-use interface for both encryption and decryption processes. |
| 20 | +- **Simple API**: Intuitive and easy-to-use interface for both encode and decode processes. |
21 | 21 | - **Robust Error Handling**: Provides clear and descriptive error messages to facilitate debugging. |
22 | 22 | - **Extensive Documentation**: Comprehensive guides and examples to help you get started quickly. |
23 | 23 |
|
24 | 24 | ## Installation |
25 | 25 |
|
26 | | -To install `bin-encrypt-decrypt` run cmd: |
| 26 | +To install `bin-encode-decode` run cmd: |
27 | 27 |
|
28 | 28 | ```sh |
29 | | -cargo add bin-encrypt-decrypt |
| 29 | +cargo add bin-encode-decode |
30 | 30 | ``` |
31 | 31 |
|
32 | 32 | ## Usage |
33 | 33 |
|
34 | | -### Encrypt |
| 34 | +### encode |
35 | 35 |
|
36 | 36 | #### Use Struct |
37 | 37 |
|
38 | 38 | ```rust |
39 | | -use bin_encrypt_decrypt::*; |
40 | | -let mut crypt_decrypt: CryptDecrypt<'_> = CryptDecrypt::new(); |
| 39 | +use bin_encode_decode::*; |
| 40 | +let mut en_decode: Endecode<'_> = Endecode::new(); |
41 | 41 | let test_str: &str = "test"; |
42 | 42 | let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_="); |
43 | | -crypt_decrypt.charset(&charset); |
44 | | -let encode: Result<String, CryptError> = crypt_decrypt.encrypt(test_str); |
| 43 | +en_decode.charset(&charset); |
| 44 | +let encode: Result<String, EncodeError> = en_decode.encode(test_str); |
45 | 45 | ``` |
46 | 46 |
|
47 | 47 | #### Use Function |
48 | 48 |
|
49 | 49 | ```rust |
50 | | -use bin_encrypt_decrypt::*; |
| 50 | +use bin_encode_decode::*; |
51 | 51 | let test_str: &str = "test"; |
52 | 52 | let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_="); |
53 | | -let encode: Result<String, CryptError> = encrypt(&charset, test_str); |
| 53 | +let encode: Result<String, EncodeError> = encode(&charset, test_str); |
54 | 54 | ``` |
55 | 55 |
|
56 | | -### Decrypt |
| 56 | +### decode |
57 | 57 |
|
58 | 58 | #### Use Struct |
59 | 59 |
|
60 | 60 | ```rust |
61 | | -use bin_encrypt_decrypt::*; |
62 | | -let mut crypt_decrypt: CryptDecrypt<'_> = CryptDecrypt::new(); |
| 61 | +use bin_encode_decode::*; |
| 62 | +let mut en_decode: Endecode<'_> = Endecode::new(); |
63 | 63 | let test_str: &str = "aab0aabLaabZaab0"; |
64 | 64 | let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_="); |
65 | | -crypt_decrypt.charset(&charset); |
66 | | -let decode: Result<String, DecryptError> = crypt_decrypt.decrypt(test_str); |
| 65 | +en_decode.charset(&charset); |
| 66 | +let decode: Result<String, DecodeError> = en_decode.decode(test_str); |
67 | 67 | ``` |
68 | 68 |
|
69 | 69 | #### Use Function |
70 | 70 |
|
71 | 71 | ```rust |
72 | | -use bin_encrypt_decrypt::*; |
73 | | -let test_str: &str = "aab0aabLaabZaab0"; |
74 | | -let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_="); |
75 | | -let decode: Result<String, DecryptError> = decrypt(&charset, test_str); |
| 72 | +use bin_encode_decode::*; |
| 73 | +let charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_="; |
| 74 | +let encoded_str = "aab0aabLaabZaab0"; |
| 75 | +let decoded_str = decode(charset, encoded_str); |
| 76 | +let charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_="; |
| 77 | +let original_str = "test"; |
| 78 | +let encoded_str = encode(charset, original_str); |
76 | 79 | ``` |
77 | 80 |
|
78 | 81 | ## License |
|
0 commit comments