export function getRandomNumber()

in src/helpers/helpers.ts [333:348]


export function getRandomNumber(
    min: number,
    max: number,
    exceptionList?: number[],
    changeResult: (value: any) => number = x => x): number {

    const cryptoObj = (<any>window).crypto || (<any>window).msCrypto;
    let randomValue = +("0." + cryptoObj.getRandomValues(new Uint8Array(1)));
    let result = changeResult(randomValue * (max - min) + min);

    if (exceptionList && exceptionList.length && includes(exceptionList, result)) {
        return getRandomNumber(min, max, exceptionList);
    }

    return result;
}