# CreateFromIndex(uint)

> Constructs a Random instance with an index that gets hashed. The index must not be uint.MaxValue.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Mathematics](/engine/6000.6/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule

```csharp
public static Random CreateFromIndex(uint index)
```

### Parameters

**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): An index that will be hashed for Random creation.  Must not be uint.MaxValue.

### Returns

| Type                                                                  | Description                                                                                  |
| --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [Random](/engine/6000.6/script-reference/unity/mathematics/random.md) | [Random](/engine/6000.6/script-reference/unity/mathematics/random.md) created from an index. |

### Remarks

Use this function when you expect to create several Random instances in a loop.

### Examples

```csharp
for (uint i = 0; i < 4096; ++i)
{
    Random rand = Random.CreateFromIndex(i);

    // Random numbers drawn from loop iteration j will be very different
    // from every other loop iteration k.
    rand.NextUInt();
}
```
