Class: Fixnum
Instance Method Summary collapse
-
#to_btwoc ⇒ Object
as a raw string.
Methods included from Crypto_math
Instance Method Details
#to_btwoc ⇒ Object
as a raw string.
34 35 36 37 38 39 |
# File 'lib/openid/util.rb', line 34 def to_btwoc bits = self.to_s(2) prepend = (8 - bits.length % 8) || (bits.index(/^1/) ? 8 : 0) bits = ('0' * prepend) + bits if prepend return [bits].pack('B*') end |