fix: remove unused function ParseNetReg
This commit is contained in:
@@ -28,7 +28,6 @@ import (
|
|||||||
"golang.org/x/text/transform"
|
"golang.org/x/text/transform"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
errors2 "github.com/pkg/errors"
|
|
||||||
"golang.org/x/crypto/pbkdf2"
|
"golang.org/x/crypto/pbkdf2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -195,19 +194,6 @@ func StringToInt(in string) (out int) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseNetReg(line string, reg *regexp.Regexp, shouldLen, index int) (int64, string, error) {
|
|
||||||
rx1 := reg.FindStringSubmatch(line)
|
|
||||||
if len(rx1) != shouldLen {
|
|
||||||
return 0, "", errors.New("find string length error")
|
|
||||||
}
|
|
||||||
i64, err := strconv.ParseInt(rx1[index], 10, 64)
|
|
||||||
total := rx1[2]
|
|
||||||
if err != nil {
|
|
||||||
return 0, "", errors2.Wrap(err, "ParseInt error")
|
|
||||||
}
|
|
||||||
return i64, total, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func PKCS5Padding(ciphertext []byte, blockSize int) []byte {
|
func PKCS5Padding(ciphertext []byte, blockSize int) []byte {
|
||||||
padding := blockSize - len(ciphertext)%blockSize
|
padding := blockSize - len(ciphertext)%blockSize
|
||||||
padText := bytes.Repeat([]byte{byte(padding)}, padding)
|
padText := bytes.Repeat([]byte{byte(padding)}, padding)
|
||||||
|
|||||||
Reference in New Issue
Block a user