github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/examples/rand/main.go (about)

     1  package main
     2  
     3  import (
     4  	"crypto/rand"
     5  	"encoding/hex"
     6  	"time"
     7  )
     8  
     9  func main() {
    10  	var result [32]byte
    11  	for {
    12  		rand.Read(result[:])
    13  		encodedString := hex.EncodeToString(result[:])
    14  		println(encodedString)
    15  		time.Sleep(time.Second)
    16  	}
    17  }