github.com/wasilibs/wazerox@v0.0.0-20240124024944-4923be63ab5f/internal/platform/crypto.go (about) 1 package platform 2 3 import ( 4 "io" 5 "math/rand" 6 ) 7 8 // seed is a fixed seed value for NewFakeRandSource. 9 // 10 // Trivia: While arbitrary, 42 was chosen as it is the "Ultimate Answer" in 11 // the Douglas Adams novel "The Hitchhiker's Guide to the Galaxy." 12 const seed = int64(42) 13 14 // NewFakeRandSource returns a deterministic source of random values. 15 func NewFakeRandSource() io.Reader { 16 return rand.New(rand.NewSource(seed)) 17 }