---
title: "random(in:using:)"
framework: swift
role: symbol
role_heading: Type Method
path: "swift/simd16/random(in:using:)-7rau7"
---

# random(in:using:)

Returns a vector with random values from within the specified range in all lanes, using the given generator as a source for randomness.

## Declaration

```swift
static func random<T>(in range: ClosedRange<Self.Scalar>, using generator: inout T) -> Self where T : RandomNumberGenerator
```
