Skip to content

Instantly share code, notes, and snippets.

@namp10010
Created June 22, 2021 23:35
Show Gist options
  • Save namp10010/052185d978ba2520464f07dc36de87a0 to your computer and use it in GitHub Desktop.
Save namp10010/052185d978ba2520464f07dc36de87a0 to your computer and use it in GitHub Desktop.
golang cryto/rand random number example
package main
// https://play.golang.org/p/3DeMCc248KQ
import (
"crypto/rand"
"encoding/binary"
"fmt"
)
func main() {
var v uint64
binary.Read(rand.Reader, binary.BigEndian, &v)
fmt.Println(v)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment