From 4ada72d89c4d5cd655c521365deae5a4fb1be5d3 Mon Sep 17 00:00:00 2001 From: Antoine Date: Tue, 29 Jan 2019 17:42:38 +0100 Subject: [PATCH] add go example --- example.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 example.go diff --git a/example.go b/example.go new file mode 100644 index 0000000..2d1d53a --- /dev/null +++ b/example.go @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + //mathRand "math/rand" + cryptoRand "crypto/rand" + "math/big" + "time" +) + +func main() { + fmt.Println("Hello, playground", time.Now()) + nBig, err := cryptoRand.Int(cryptoRand.Reader, big.NewInt(27)) + if err != nil { + panic(err) + } + n := nBig.Int64() + + //b := []byte{0} + //r := cryptoRand.Reader.Read(b) + fmt.Println("r", n) + //fmt.Println("Random", mathRand.Seed(r).Intn(9)) +}