---
title: "init(seed:)"
framework: gameplaykit
role: symbol
role_heading: Initializer
path: "gameplaykit/gkmersennetwisterrandomsource/init(seed:)"
---

# init(seed:)

Initializes a random source with the specified seed value.

## Declaration

```swift
init(seed: UInt64)
```

## Parameters

- `seed`: A seed value for the random number generator.

## Return Value

Return Value A new, independent random source.

## Discussion

Discussion Any two random sources initialized with the same seed data will generate the same sequence of random numbers. To replicate the behavior of an existing GKMersenneTwisterRandomSource instance, read that instance’s init(seed:) property and then create a new instance by passing the resulting data to the seed initializer. For a source of high-entropy seed data, see the SecRandomCopyBytes(_:_:_:) function.

## See Also

### Creating a Random Source

- [init()](gameplaykit/gkmersennetwisterrandomsource/init().md)
