Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 

README.md

mruby-libqrng

An interface to libQRNG for mruby.

Prerequisites

conf.cflags << '-I"/path/to/libQRNG"'
conf.ldflags << '-L"/path/to/libQRNG"'

Installation

Usage

qrng = QRNG.new 'AzureDiamond', 'hunter2', true  # username, password, use ssl (optional)
pw = qrng.password 13, 'ABCdef123'  # password_length, tobeused_password_chars (optional)
puts pw  # => 2dBfCC123CfeC
int = qrng.data :int  # :byte (String), :int (Fixnum), :double (Float [between 0 and 1])
puts int  # => 2143097836
int = qrng.data :int, 3
puts int  # => [-984391892, 1743334411, -1048288211]
qrng.disconnect

q = QRNG.new 'AzureDiamond', 'hunter2' do |qrng|
  puts qrng.connected?  # => true
  puts qrng.ssl? # => false
  floats = qrng[:double, 0xffff]
  puts floats  # => numbers, numbers everywhere
end
puts q.connected?  # => false

License

MIT License (http://opensource.org/licenses/MIT)

About

an interface to libQRNG and my first mruby gem

Resources

Releases

No releases published
You can’t perform that action at this time.