Class: Exonum::PublicKeyT

Inherits:
Object
  • Object
show all
Defined in:
lib/exonum/types/primitive.rb

Class Method Summary collapse

Class Method Details

.fixed?Boolean

Returns:

  • (Boolean)


213
214
215
# File 'lib/exonum/types/primitive.rb', line 213

def self.fixed?
  true
end

.serialize(value, buffer, from, shift = 0) ⇒ Object



217
218
219
220
221
222
223
# File 'lib/exonum/types/primitive.rb', line 217

def self.serialize value, buffer, from, shift=0
  raise "Expecting #{size} bytes in hex" unless value.is_a?(String) and value.length == size*2
  [value].pack('H*').bytes.each do |byte|
    buffer[from] = byte
    from += 1
  end
end

.sizeObject



209
210
211
# File 'lib/exonum/types/primitive.rb', line 209

def self.size
  32
end