I'm building a lottery game contract and I need to get a range of values from chainlink VRF's number. The range is the length of the players list. For simplicity, I've made a simple contract that demonstrates my idea of how to get a ranged random number from Chainlink's VRF number. To do this I have decided to take the modulo N of Chainlink's number, where N is the length of the players list.
My worry is that this process makes the number less random, more biased and therefore not fair. Am I right to worry? If so, what's a better approach for this problem?
pragma solidity ^0.8.0;
contract GetRandomNumber{
string[] playersList = ["bob", "alice", "lux", "ahri", "nunu", "amumu", "jax", "olaf", "jinx", "vayne", "twitch", "alistar", "annie", "leona", "warwick"];
uint256 public randomNumber;
//actual random number from Chainlink VRF
uint256[] chainlinkVRFNumberList = [64062631830175213092191689838209884690462398265195175129745934432936884152163];
uint256 public chainlinkVRFNumber = chainlinkVRFNumberList[0];
constructor(){
getNumber(chainlinkVRFNumber);
}
function getNumber(uint256 x) internal {
uint256 value = (x % playersList.length) + 1;
randomNumber = value;
}
}```