github.com/tetratelabs/wazero@v1.7.3-0.20240513003603-48f702e154b5/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  }