Skip to content

Commit 3a1f41f

Browse files
committed
feat: v1.1.30
1 parent a2394e2 commit 3a1f41f

File tree

5 files changed

+10
-63
lines changed

5 files changed

+10
-63
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bin-encode-decode"
3-
version = "1.1.29"
3+
version = "1.1.30"
44
readme = "README.md"
55
edition = "2024"
66
authors = ["[email protected]"]

README.md

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -30,59 +30,6 @@ To install `bin-encode-decode` run cmd:
3030
cargo add bin-encode-decode
3131
```
3232

33-
## Usage
34-
35-
### encode
36-
37-
#### Use Struct
38-
39-
```rust
40-
use bin_encode_decode::*;
41-
42-
let mut en_decode: Charset<'_> = Charset::new();
43-
let test_str: &str = "test";
44-
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
45-
en_decode.charset(&charset);
46-
let encode: Result<String, EncodeError> = en_decode.encode(test_str);
47-
```
48-
49-
#### Use Function
50-
51-
```rust
52-
use bin_encode_decode::*;
53-
54-
let test_str: &str = "test";
55-
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
56-
let encode: Result<String, EncodeError> = Encode::execute(&charset, test_str);
57-
```
58-
59-
### decode
60-
61-
#### Use Struct
62-
63-
```rust
64-
use bin_encode_decode::*;
65-
66-
let mut en_decode: Charset<'_> = Charset::new();
67-
let test_str: &str = "aab0aabLaabZaab0";
68-
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
69-
en_decode.charset(&charset);
70-
let decode: Result<String, DecodeError> = en_decode.decode(test_str);
71-
```
72-
73-
#### Use Function
74-
75-
```rust
76-
use bin_encode_decode::*;
77-
78-
let charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=";
79-
let encoded_str = "aab0aabLaabZaab0";
80-
let decoded_str = Decode::execute(charset, encoded_str);
81-
let charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=";
82-
let original_str = "test";
83-
let encoded_str = Encode::execute(charset, original_str);
84-
```
85-
8633
## License
8734

8835
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

src/common/cfg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ fn test_crypt_decode() {
66
let test_str: &str = "test";
77
let mut charset: String = String::new();
88
for i in 0..26 {
9-
let ch: char = ('a' as u8 + i) as char;
9+
let ch: char = (b'a' + i) as char;
1010
charset.push(ch);
1111
}
1212
for i in 0..26 {
13-
let ch: char = ('A' as u8 + i) as char;
13+
let ch: char = (b'A' + i) as char;
1414
charset.push(ch);
1515
}
1616
for i in 0..10 {
17-
let ch: char = ('0' as u8 + i) as char;
17+
let ch: char = (b'0' + i) as char;
1818
charset.push(ch);
1919
}
2020
charset.push_str("_=");

src/decode/cfg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ use crate::*;
44
fn test_decode() {
55
let mut charset: String = String::new();
66
for i in 0..26 {
7-
let ch: char = ('a' as u8 + i) as char;
7+
let ch: char = (b'a' + i) as char;
88
charset.push(ch);
99
}
1010
for i in 0..26 {
11-
let ch: char = ('A' as u8 + i) as char;
11+
let ch: char = (b'A' + i) as char;
1212
charset.push(ch);
1313
}
1414
for i in 0..10 {
15-
let ch: char = ('0' as u8 + i) as char;
15+
let ch: char = (b'0' + i) as char;
1616
charset.push(ch);
1717
}
1818
charset.push_str("_=");

src/encode/cfg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ use crate::*;
44
fn test_decode() {
55
let mut charset: String = String::new();
66
for i in 0..26 {
7-
let ch: char = ('a' as u8 + i) as char;
7+
let ch: char = (b'a' + i) as char;
88
charset.push(ch);
99
}
1010
for i in 0..26 {
11-
let ch: char = ('A' as u8 + i) as char;
11+
let ch: char = (b'A' + i) as char;
1212
charset.push(ch);
1313
}
1414
for i in 0..10 {
15-
let ch: char = ('0' as u8 + i) as char;
15+
let ch: char = (b'0' + i) as char;
1616
charset.push(ch);
1717
}
1818
charset.push_str("_=");

0 commit comments

Comments
 (0)