# Module: crypto/random

## crypto/random

Source:
  - crypto/random.js, line 20

### Methods

#### <static> getPseudoRandom(from, to) → {Integer}

  Return a pseudo-random number in the specified range

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `from` | Integer | Min of the random number
  `to` | Integer | Max of the random number (max 32bit)

  Source:
    - crypto/random.js, line 44

  ##### Returns:

  A pseudo random number
  Type
    Integer

#### <static> getRandomBigInteger(bits) → {BigInteger}

  Create a secure random big integer of bits length

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `bits` | Integer | Bit length of the MPI to create

  Source:
    - crypto/random.js, line 74

  ##### Returns:

  Resulting big integer
  Type
    BigInteger

#### <static> getRandomBytes(length) → {String}

  Retrieve secure random byte string of the specified length

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `length` | Integer | Length in bytes to generate

  Source:
    - crypto/random.js, line 30

  ##### Returns:

  Random byte string
  Type
    String

#### <static> getSecureRandom(from, to) → {Integer}

  Return a secure random number in the specified range

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `from` | Integer | Min of the random number
  `to` | Integer | Max of the random number (max 32bit)

  Source:
    - crypto/random.js, line 54

  ##### Returns:

  A secure random number
  Type
    Integer