summaryrefslogtreecommitdiff
path: root/vendor/github.com/tetratelabs/wazero/internal/platform/crypto.go
blob: c141f00f0c6be32111bc2863f07bd4eeab5b68d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package platform

import (
	"io"
	"math/rand"
)

// seed is a fixed seed value for NewFakeRandSource.
//
// Trivia: While arbitrary, 42 was chosen as it is the "Ultimate Answer" in
// the Douglas Adams novel "The Hitchhiker's Guide to the Galaxy."
const seed = int64(42)

// NewFakeRandSource returns a deterministic source of random values.
func NewFakeRandSource() io.Reader {
	return rand.New(rand.NewSource(seed))
}