Skip to content

Commit 3b7fa1f

Browse files
committed
Use crypto rand library
1 parent aff3d13 commit 3b7fa1f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

rstr/main.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package main
22

33
import (
4+
"crypto/rand"
45
"encoding/base64"
56
"flag"
67
"fmt"
7-
"math/rand"
88
"strconv"
9-
"time"
109

1110
"github.com/bcext/cashutil/base58"
1211
"github.com/qshuai/tcolor"
@@ -27,7 +26,6 @@ func main() {
2726
encode := flag.String("encode", string(base64Encoding), "Please input encode type (base64 encoded string with character '+/=')")
2827
flag.Parse()
2928

30-
rand.Seed(time.Now().UnixNano())
3129
if *length > bytesLengthLimit {
3230
fmt.Println(tcolor.WithColor(tcolor.Yellow, "the input length too big. use default length: "+strconv.Itoa(defaultBytesLength)))
3331
*length = defaultBytesLength

0 commit comments

Comments
 (0)