Pārlūkot izejas kodu

random: seed with Nanoseconds.

Dmitry Chestnykh 14 gadi atpakaļ
vecāks
revīzija
f14d4a9979
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      random.go

+ 1 - 1
random.go

@@ -14,7 +14,7 @@ const idLen = 20
 var idChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")
 var idChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")
 
 
 func init() {
 func init() {
-	rand.Seed(time.Seconds())
+	rand.Seed(time.Nanoseconds())
 }
 }
 
 
 // RandomDigits returns a byte slice of the given length containing
 // RandomDigits returns a byte slice of the given length containing