Method: Mongo::Crypt::Hooks.random

Defined in:
lib/mongo/crypt/hooks.rb

.random(num_bytes) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Crypto secure random function

Raises:

  • (Exception)

    Exceptions raised during encryption are propagated to caller.



62
63
64
# File 'lib/mongo/crypt/hooks.rb', line 62

def random(num_bytes)
  SecureRandom.random_bytes(num_bytes)
end