add go example
This commit is contained in:
parent
a327673cd4
commit
4ada72d89c
23
example.go
Normal file
23
example.go
Normal file
@ -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))
|
||||
}
|
Loading…
Reference in New Issue
Block a user