A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://rubydoc.info/github/cryptosphere/rbnacl/RbNaCl/Random below:

Random – Documentation for cryptosphere/rbnacl (main) – RubyDoc.info

Module: RbNaCl::Random
Extended by:
Sodium
Defined in:
lib/rbnacl/random.rb
Overview

Functions for random number generation

This uses the underlying source of random number generation on the OS, so /dev/urandom on UNIX-like systems, and the MS crypto providor on windows.

Class Method Summary collapse Methods included from Sodium

primitive, sodium_constant, sodium_function, sodium_function_with_return_code, sodium_primitive, sodium_type

Class Method Details .random_bytes(n = 32) ⇒ String

Returns a string of random bytes

23
24
25
26
27
# File 'lib/rbnacl/random.rb', line 23

def self.random_bytes(n = 32)
  buf = RbNaCl::Util.zeros(n)
  @mutex.synchronize { c_random_bytes(buf, n) }
  buf
end

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4