getRandomInteger
================
Generate a random N-bit integer.

Introduction
------------
The ``getRandomInteger`` function generates a random integer of N bits. The number is generated by first obtaining a random set of **N** bits, then ensuring the number is an **N**-bit intger through extending and masking of the bits. The logic for generating the random bits is similar to the one described in documentation if ``os.urandom``. It uses ``BcryptGenRandom`` function from the ``bcrypt`` library in Windows and ``/dev/urandom`` in Unix-based systems as the randomness source to generate the random bits (refer `this <https://docs.python.org/3/library/os.html#os.urandom>`_). The function can generate integers of any size if the ``force`` parameter is set to **True**. However, for performance reasons, the function is limited to generating integers of size <= 2^18 if ``force=False``.

.. function:: getRandomInteger(N=1024, force=False)

    :param N: The number of bits in the generated integer, defaults to 1024. ``N`` is asserted to be <= 2^18 for performance reasons.
    :type N: int
    :param force: If True, the function will generate a random integer of any size, defaults to **False** for performance reasons.
    :type force: bool
    :return: A random integer of N bits
    :rtype: int

Example Usage
-------------
.. code-block:: python

    # Example usage of getRandomInteger to generate a 5-bit integer
    from cryptosystems import getRandomInteger
    getRandomInteger(5) # 19
