Module: Hidr::Impl

Included in:
Hidr
Defined in:
lib/hidr/impl.rb

Instance Method Summary collapse

Instance Method Details

#e(o) ⇒ Object



9
# File 'lib/hidr/impl.rb', line 9

def e(o);s(h(o));end

#h(m) ⇒ Object



7
# File 'lib/hidr/impl.rb', line 7

def h(m);m.unpack('b*').first.split("").map{|v|v=='0'?@o[:b0]:@o[:b1]}.join;end

#s(n) ⇒ Object



8
# File 'lib/hidr/impl.rb', line 8

def s(n);[n.chars.to_a.map{|y|y==@o[:b0]?'0':'1'}.join].pack('b*');end