Module: RubyTorrent::StringExpandBits

Includes:
StringMapBytes
Defined in:
lib/rubytorrent/message.rb

Instance Method Summary collapse

Methods included from StringMapBytes

#map_bytes

Instance Method Details

#expand_bitsObject

just for debugging purposes



42
43
44
45
46
# File 'lib/rubytorrent/message.rb', line 42

def expand_bits # just for debugging purposes
  self.map_bytes do |b|
    (0 .. 7).map { |i| ((b & (1 << (7 - i))) == 0 ? "0" : "1") }
  end.flatten.join
end