Sha256: 4f64442542a1a4fb57530b2229d6de423c6adedb33c68bbd9d7bc92179d42e69
Contents?: true
Size: 563 Bytes
Versions: 11
Compression:
Stored size: 563 Bytes
Contents
# frozen_string_literal: true module Lightning module Onion class HopData attr_accessor :realm, :per_hop, :hmac def initialize(realm, per_hop, hmac) @realm = realm @per_hop = per_hop @hmac = hmac end def self.parse(payload) realm, per_hop_payload, hmac = payload.unpack('Ca32a32') per_hop = Lightning::Onion::PerHop.parse(per_hop_payload) new(realm, per_hop, hmac) end def to_payload [realm, per_hop.to_payload, hmac].pack('Ca32a32') end end end end
Version data entries
11 entries across 11 versions & 1 rubygems