All files cryptorandomt.js

100% Statements 10/10
100% Branches 0/0
100% Functions 1/1
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13  1x 1x 1x 1x 106x 106x 106x 106x 106x   1x  
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCryptoRandomInt = void 0;
var crypto = require('crypto');
var getCryptoRandomInt = function (max) {
    var min = 0;
    var array = crypto.randomBytes(1).toJSON().data;
    var randomNum = Number('0.' + array[0]);
    randomNum = Math.floor(randomNum * (max - min + 1)) + min;
    return randomNum;
};
exports.getCryptoRandomInt = getCryptoRandomInt;