Skip to content

cremno/mruby-libqrng

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published