Module: RandomBytes

Extended by:
FFI::Library, Sodium::Utils
Defined in:
lib/random_bytes.rb

Constant Summary

Constants included from Sodium::Utils

Sodium::Utils::HEXY, Sodium::Utils::ZERO

Class Method Summary collapse

Methods included from Sodium::Utils

bin2hex, check_length, get_size, hex2bin, zeros

Class Method Details

.buf(size) ⇒ Object



18
19
20
21
22
# File 'lib/random_bytes.rb', line 18

def buf(size)
  buf = zeros(size)
  randombytes_buf(buf, size)
  buf
end