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 collapseReturns a string of random bytes.
primitive, sodium_constant, sodium_function, sodium_function_with_return_code, sodium_primitive, sodium_type
Class Method Details .random_bytes(n = 32) ⇒ StringReturns 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