UNPKG

@broxus/js-core

Version:

MobX-based JavaScript Core library

13 lines (12 loc) 391 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRandomUint = getRandomUint; /** * @deprecated Use **getRandomInt** instead * @param {8 | 16 | 32 | 64 | 128 | 160 | 256} bits * @returns {string} */ function getRandomUint(bits = 32) { // eslint-disable-next-line no-bitwise return Math.abs(~~(Math.random() * (2 ** bits)) | 0).toString(); }