You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Correct me if I am wrong, but I think 99 will have biggest chance to be rolled, because it has chance of being rolled as every other number + chance that all substrings converted to number will be over 1e6.
const getResult = hashedValue => {
// the offset of the interval
let index = 0;
// result variable
let result;
do {
// get the decimal value from an interval of 5 hex letters
result = parseInt(hashedValue.substring(index * 5, index * 5 + 5), 16);
// increment the offset in case we will need to repeat the operation above
index += 1;
// if all the numbers were over 999999 and we reached the end of the string, we set that to a default value of 9999 (99 as a result)
if (index * 5 + 5 > 129) {
result = 9999;
break;
}
} while (result >= 1e6);
// the result is between 0-999999 and we need to convert if into a 4 digit number
// we a apply a modulus of 1000 and the 4 digit number is further split into a 2 digit number with decimals
return [result % 1e4] * 1e-2;
};
The text was updated successfully, but these errors were encountered:
Correct me if I am wrong, but I think 99 will have biggest chance to be rolled, because it has chance of being rolled as every other number + chance that all substrings converted to number will be over 1e6.
The text was updated successfully, but these errors were encountered: