Module: Hotbits

Defined in:
lib/hotbits.rb,
lib/hotbits/version.rb

Constant Summary collapse

BASE_URI =
"https://www.fourmilab.ch/cgi-bin/Hotbits?fmt=xml&"
VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.ascii(count = 4) ⇒ Object



9
10
11
12
# File 'lib/hotbits.rb', line 9

def self.ascii(count = 4)
  doc = Nokogiri::XML.parse(raw(count))
  doc.css('random-data')[0].content.strip
end

.bytes(count = 4) ⇒ Object



14
15
16
# File 'lib/hotbits.rb', line 14

def self.bytes(count = 4)
  ascii(count).split.map{|s| s.to_i(16)}
end