# RandomNumberV2Interface

> Primary interface for random number generation.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

Source: https://dev.flare.network/network/solidity-reference/RandomNumberV2Interface

Primary interface for random number generation. This is a long-term support (LTS) interface, designed to ensure continuity even as underlying contracts evolve or protocols migrate to new versions.

Sourced from `RandomNumberV2Interface.sol` on [GitHub](https://github.com/flare-foundation/flare-smart-contracts-v2/blob/main/contracts/userInterfaces/LTS/RandomNumberV2Interface.sol).

## Functions[​](#functions "Direct link to Functions")

### getRandomNumber[​](#getrandomnumber "Direct link to getRandomNumber")

Returns the current random number, its timestamp and the flag indicating if it is secure.

```
function getRandomNumber() external view returns (    uint256 _randomNumber,    bool _isSecureRandom,    uint256 _randomTimestamp);
```

#### Returns[​](#returns "Direct link to Returns")

-   `_randomNumber`: The current random number.
-   `_isSecureRandom`: The flag indicating if the random number is secure.
-   `_randomTimestamp`: The timestamp of the random number.

### getRandomNumberHistorical[​](#getrandomnumberhistorical "Direct link to getRandomNumberHistorical")

Returns the historical random number for a given \_votingRoundId, its timestamp and the flag indicating if it is secure. If no finalization in the \_votingRoundId, the function reverts.

```
function getRandomNumberHistorical(    uint256 _votingRoundId) external view returns (    uint256 _randomNumber,    bool _isSecureRandom,    uint256 _randomTimestamp);
```

#### Parameters[​](#parameters "Direct link to Parameters")

-   `_votingRoundId`: The voting round id.

#### Returns[​](#returns-1 "Direct link to Returns")

-   `_randomNumber`: The current random number.
-   `_isSecureRandom`: The flag indicating if the random number is secure.
-   `_randomTimestamp`: The timestamp of the random number.
