Class: Bignum
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.
46 47 48 49 50 51 |
# File 'lib/openid/util.rb', line 46 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 |