Class: IOTA::Multisig::Address
- Inherits:
-
Object
- Object
- IOTA::Multisig::Address
- Defined in:
- lib/iota/multisig/address.rb
Instance Method Summary collapse
- #absorb(digest) ⇒ Object
- #finalize(digest = nil) ⇒ Object
-
#initialize(digests = nil) ⇒ Address
constructor
A new instance of Address.
Constructor Details
Instance Method Details
#absorb(digest) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/iota/multisig/address.rb', line 12 def absorb(digest) # Construct array digests = digest.class == Array ? digest : [digest] # Add digests digests.each do |d| # Get trits of digest digestTrits = IOTA::Crypto::Converter.trits(d) # Absorb @kerl.absorb(digestTrits, 0, digestTrits.length) end self end |
#finalize(digest = nil) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/iota/multisig/address.rb', line 28 def finalize(digest = nil) # Absorb last digest if passed absorb(digest) if digest # Squeeze the address trits addressTrits = [] @kerl.squeeze(addressTrits, 0, IOTA::Crypto::Kerl::HASH_LENGTH) # Convert trits into trytes and return the address IOTA::Crypto::Converter.trytes(addressTrits) end |