File: bitwise.rb

package info (click to toggle)
ruby-rqrcode 0.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 248 kB
  • ctags: 87
  • sloc: ruby: 987; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 261 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
module RQRCode
  module CoreExtensions #:nodoc:
    module Integer #:nodoc:
      module Bitwise
        def rszf(count)
          # zero fill right shift
          (self >> count) & ((2 ** ((self.size * 8) - count))-1)
        end
      end
    end
  end
end