Skip to content

Instantly share code, notes, and snippets.

@sillyfellow
Created May 25, 2016 10:31
Show Gist options
  • Save sillyfellow/4b42bee7c195f3853a5e2ed5e5fbaecc to your computer and use it in GitHub Desktop.
Save sillyfellow/4b42bee7c195f3853a5e2ed5e5fbaecc to your computer and use it in GitHub Desktop.
import (
"crypto/rand"
"encoding/binary"
)
func randUInt32() (uint32, error) {
bytes := make([]byte, 4)
_, err := rand.Read(bytes)
return binary.BigEndian.Uint32(bytes), err
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment