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)


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

def self.fixed?
  true
end

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



214
215
216
217
218
219
220
# File 'lib/exonum/types/primitive.rb', line 214

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



206
207
208
# File 'lib/exonum/types/primitive.rb', line 206

def self.size
  32
end