---
title: "random(using:)"
framework: swift
role: symbol
role_heading: Type Method
path: "swift/simdmask/random(using:)"
---

# random(using:)

Returns a vector mask with true or false randomly assigned in each lane, using the given generator as a source for randomness.

## Declaration

```swift
static func random<T>(using generator: inout T) -> SIMDMask<Storage> where T : RandomNumberGenerator
```
