Class: Bignum

### Home Classes Methods

### In Files

- lib/openid/util.rb

### Parent

Object

### Methods

- #to_btwoc

### Included Modules

- Crypto_math

### Class/Module Index

Quicksearch

- OpenID
- OpenID::Association
- OpenID::AssociationManager
- OpenID::AuthenticationError
- OpenID::BaseAssociationManager
- OpenID::Consumer
- OpenID::ConsumerAssociation
- OpenID::DiffieHelmanAssociator
- OpenID::DumbAssociationManager
- OpenID::NoArgumentsError
- OpenID::NoOpenIDArgs
- OpenID::ProtocolError
- OpenID::Request
- OpenID::Response
- OpenID::ServerAssociation
- OpenID::SimpleHTTPClient
- OpenID::UserCancelled
- OpenID::UserSetupNeeded
- OpenID::ValueMismatchError
- String
- String::OpenID
- Bignum
- Crypto_math
- DateTime
- Fixnum

No matching classes.

# Bignum

### Public Instance Methods

to_btwoc() click to toggle source

Returns a number in big endian two's complement notation, stored as a raw string.

    # 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.