Module: RubyTorrent::StringToBarray
- Includes:
- StringMapBytes
- Defined in:
- lib/rubytorrent/peer.rb
Instance Method Summary collapse
Methods included from StringMapBytes
Instance Method Details
#to_barray ⇒ Object
53 54 55 56 57 |
# File 'lib/rubytorrent/peer.rb', line 53 def self.map_bytes do |b| (0 .. 7).map { |i| (b & (1 << (7 - i))) != 0 } end.flatten end |