From 3b7fa1f6de9e58067a444e5c9ea73df23fbfadea Mon Sep 17 00:00:00 2001 From: qshuai Date: Mon, 22 Oct 2018 22:37:39 +0800 Subject: [PATCH] Use crypto rand library --- rstr/main.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rstr/main.go b/rstr/main.go index b0edcbd..23594af 100644 --- a/rstr/main.go +++ b/rstr/main.go @@ -1,12 +1,11 @@ package main import ( + "crypto/rand" "encoding/base64" "flag" "fmt" - "math/rand" "strconv" - "time" "github.com/bcext/cashutil/base58" "github.com/qshuai/tcolor" @@ -27,7 +26,6 @@ func main() { encode := flag.String("encode", string(base64Encoding), "Please input encode type (base64 encoded string with character '+/=')") flag.Parse() - rand.Seed(time.Now().UnixNano()) if *length > bytesLengthLimit { fmt.Println(tcolor.WithColor(tcolor.Yellow, "the input length too big. use default length: "+strconv.Itoa(defaultBytesLength))) *length = defaultBytesLength