Class: Xelor::Time

Inherits:
Object
  • Object
show all
Defined in:
lib/xelor.rb

Instance Method Summary collapse

Instance Method Details

#base32(size) ⇒ Object



26
27
28
29
# File 'lib/xelor.rb', line 26

def base32(size)
  num = chaos(size)
  return Bases.val(num).in_base(32).to_base(32)
end

#base64(size) ⇒ Object



31
32
33
34
# File 'lib/xelor.rb', line 31

def base64(size)
  num = chaos(size)
  return Bases.val(num).in_base(32).to_base(64)
end

#binary(size) ⇒ Object



6
7
8
9
# File 'lib/xelor.rb', line 6

def binary(size)
  num = chaos(size)
  return Bases.val(num).in_base(32).to_base(2)
end

#decimal(size) ⇒ Object



16
17
18
19
# File 'lib/xelor.rb', line 16

def decimal(size)
  num = chaos(size)
  return Bases.val(num).in_base(32).to_base(10)
end

#hex(size) ⇒ Object



21
22
23
24
# File 'lib/xelor.rb', line 21

def hex(size)
  num = chaos(size)
  return Bases.val(num).in_base(32).to_base(16)
end

#octal(size) ⇒ Object



11
12
13
14
# File 'lib/xelor.rb', line 11

def octal(size)
  num = chaos(size)
  return Bases.val(num).in_base(32).to_base(8)
end

#string(size) ⇒ Object



36
37
38
# File 'lib/xelor.rb', line 36

def string(size)
  return [hex(size)].pack('H*')
end