Class: BitcoinCigs::Signature
- Inherits:
-
Object
- Object
- BitcoinCigs::Signature
- Includes:
- CryptoHelper
- Defined in:
- lib/bitcoin_cigs/signature.rb
Instance Attribute Summary collapse
-
#r ⇒ Object
Returns the value of attribute r.
-
#s ⇒ Object
Returns the value of attribute s.
Instance Method Summary collapse
-
#initialize(r, s) ⇒ Signature
constructor
A new instance of Signature.
- #ser ⇒ Object
Methods included from CryptoHelper
#decode58, #decode64, #decode_hex, #encode58, #encode64, #inverse_mod, #leftmost_bit, #ripemd160, #sha256, #sqrt_mod, #str_to_num
Constructor Details
#initialize(r, s) ⇒ Signature
Returns a new instance of Signature.
7 8 9 10 |
# File 'lib/bitcoin_cigs/signature.rb', line 7 def initialize(r, s) self.r = r self.s = s end |
Instance Attribute Details
#r ⇒ Object
Returns the value of attribute r.
5 6 7 |
# File 'lib/bitcoin_cigs/signature.rb', line 5 def r @r end |
#s ⇒ Object
Returns the value of attribute s.
5 6 7 |
# File 'lib/bitcoin_cigs/signature.rb', line 5 def s @s end |
Instance Method Details
#ser ⇒ Object
12 13 14 |
# File 'lib/bitcoin_cigs/signature.rb', line 12 def ser decode_hex("%064x%064x" % [r, s]) end |