---
title: next()
framework: swift
role: symbol
role_heading: Instance Method
path: swift/systemrandomnumbergenerator/next()-2x0ly
---

# next()

Returns a value from a uniform, independent distribution of binary data.

## Declaration

```swift
mutating func next<T>() -> T where T : FixedWidthInteger, T : UnsignedInteger
```

## Return Value

Return Value A random value of T. Bits are randomly distributed so that every value of T is equally likely to be returned.

## Discussion

Discussion Use this method when you need random binary data to generate another value. If you need an integer value within a specific range, use the static random(in:using:) method on that integer type instead of this method.

## See Also

### Generating Random Binary Data

- [next()](swift/systemrandomnumbergenerator/next().md)
- [next(upperBound:)](swift/systemrandomnumbergenerator/next(upperbound:).md)
