Skip to content

Commit 75640a5

Browse files
authored
Update w7.go
1 parent dadcad2 commit 75640a5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

w7.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package w7dth
1+
package w7
22

33
import (
44
"crypto/aes"
@@ -9,15 +9,15 @@ import (
99
"io"
1010
)
1111

12-
type W7DTH struct {
12+
type W7 struct {
1313
key []byte
1414
}
1515

16-
func New() *W7DTH {
17-
return &W7DTH{}
16+
func New() *W7 {
17+
return &W7{}
1818
}
1919

20-
func (w *W7DTH) Key(generate string) (string, error) {
20+
func (w *W7) Key(generate string) (string, error) {
2121
if generate == "generate" {
2222
key := make([]byte, 32)
2323
_, err := rand.Read(key)
@@ -35,7 +35,7 @@ func (w *W7DTH) Key(generate string) (string, error) {
3535
return generate, nil
3636
}
3737

38-
func (w *W7DTH) Encrypt(data string) (string, error) {
38+
func (w *W7) Encrypt(data string) (string, error) {
3939
block, err := aes.NewCipher(w.key)
4040
if err != nil {
4141
return "", err
@@ -52,7 +52,7 @@ func (w *W7DTH) Encrypt(data string) (string, error) {
5252
return hex.EncodeToString(ciphertext), nil
5353
}
5454

55-
func (w *W7DTH) Decrypt(data string) (string, error) {
55+
func (w *W7) Decrypt(data string) (string, error) {
5656
ciphertext, err := hex.DecodeString(data)
5757
if err != nil {
5858
return "", err

0 commit comments

Comments
 (0)