Class: Immudb::KV

Inherits:
Object
  • Object
show all
Defined in:
lib/immudb/kv.rb

Instance Method Summary collapse

Constructor Details

#initialize(key, value) ⇒ KV

Returns a new instance of KV.



15
16
17
18
# File 'lib/immudb/kv.rb', line 15

def initialize(key, value)
  @key = key
  @value = value
end

Instance Method Details

#digestObject



20
21
22
23
# File 'lib/immudb/kv.rb', line 20

def digest
  valdigest = Digest::SHA256.digest(@value.nil? ? "" : @value)
  Digest::SHA256.digest(@key + valdigest)
end