math/rand package
package main
import (
"fmt"
"math/rand"
)
func main() {
n := 8
randomBytes := make([]byte, n)
rand.Read(randomBytes)
fmt.Println(randomBytes)
}
package main
import (
"fmt"
"math/rand"
)
func main() {
n := 8
randomBytes := make([]byte, n)
rand.Read(randomBytes)
fmt.Println(randomBytes)
}
Leave a Comment
Cancel reply