We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6cd7fd2 commit 15cb852Copy full SHA for 15cb852
1 file changed
framework/crypto/cryptos.go
@@ -2,8 +2,8 @@ package cryptos
2
3
import (
4
"crypto/md5"
5
- "math/rand"
6
"encoding/hex"
+ "math/rand"
7
"time"
8
)
9
@@ -17,7 +17,7 @@ func GetMd5String(s string) string {
17
// GetRandString returns randominzed string with given length
18
func GetRandString(length int) string {
19
bytes := []byte("0123456789abcdefghijklmnopqrstuvwxyz")
20
- result := []byte{}
+ result := make([]byte, 0, length)
21
r := rand.New(rand.NewSource(time.Now().UnixNano()))
22
for i := 0; i < length; i++ {
23
result = append(result, bytes[r.Intn(len(bytes))])
0 commit comments