From: Colin P. Mccabe Date: Thu, 22 Jul 2021 23:28:36 +0000 (-0700) Subject: pickrand.go: use longer random buffer X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa4183dd778e5e3a0ceeec14f7715e790982b6b6;p=cmccabe-bin pickrand.go: use longer random buffer --- diff --git a/pickrand.go b/pickrand.go index 1bf4844..79c4076 100644 --- a/pickrand.go +++ b/pickrand.go @@ -28,7 +28,7 @@ func main() { fmt.Fprintf(os.Stderr, "** Error: %s\n", err.Error()) os.Exit(1) } - var b [8]byte + var b [16]byte _, err = rand.Read(b[:]) if err != nil { fmt.Fprintf(os.Stderr, "Failed to access cryptographic randomness. " + @@ -42,5 +42,5 @@ func main() { } j := int(i.Uint64()) - fmt.Printf("%s\n", root + "/" + files[j]) + fmt.Printf("%s\n", files[j]) }