Class: BitcoinCigs::Signature

Inherits:
Object
  • Object
show all
Includes:
CryptoHelper
Defined in:
lib/bitcoin_cigs/signature.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rObject

Returns the value of attribute r.



5
6
7
# File 'lib/bitcoin_cigs/signature.rb', line 5

def r
  @r
end

#sObject

Returns the value of attribute s.



5
6
7
# File 'lib/bitcoin_cigs/signature.rb', line 5

def s
  @s
end

Instance Method Details

#serObject



12
13
14
# File 'lib/bitcoin_cigs/signature.rb', line 12

def ser
  decode_hex("%064x%064x" % [r, s])
end