File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
- package w7dth
1
+ package w7
2
2
3
3
import (
4
4
"crypto/aes"
@@ -9,15 +9,15 @@ import (
9
9
"io"
10
10
)
11
11
12
- type W7DTH struct {
12
+ type W7 struct {
13
13
key []byte
14
14
}
15
15
16
- func New () * W7DTH {
17
- return & W7DTH {}
16
+ func New () * W7 {
17
+ return & W7 {}
18
18
}
19
19
20
- func (w * W7DTH ) Key (generate string ) (string , error ) {
20
+ func (w * W7 ) Key (generate string ) (string , error ) {
21
21
if generate == "generate" {
22
22
key := make ([]byte , 32 )
23
23
_ , err := rand .Read (key )
@@ -35,7 +35,7 @@ func (w *W7DTH) Key(generate string) (string, error) {
35
35
return generate , nil
36
36
}
37
37
38
- func (w * W7DTH ) Encrypt (data string ) (string , error ) {
38
+ func (w * W7 ) Encrypt (data string ) (string , error ) {
39
39
block , err := aes .NewCipher (w .key )
40
40
if err != nil {
41
41
return "" , err
@@ -52,7 +52,7 @@ func (w *W7DTH) Encrypt(data string) (string, error) {
52
52
return hex .EncodeToString (ciphertext ), nil
53
53
}
54
54
55
- func (w * W7DTH ) Decrypt (data string ) (string , error ) {
55
+ func (w * W7 ) Decrypt (data string ) (string , error ) {
56
56
ciphertext , err := hex .DecodeString (data )
57
57
if err != nil {
58
58
return "" , err
You can’t perform that action at this time.
0 commit comments