func (c SimpleCache) Equal(o *SimpleCache) bool {
	for k, v1 := range c.cached {
		v2, ok := o.cached[k]
		if !ok {
			return false
		}
		if !bytes.Equal(v1, v2) {
			return false
		}
	}
	return true
}
Equal function checks if every element from current cache (C) exists
in the cache to compare (O). It does not check that every element from (O)
exists in current cache (C).
package cache
import (
	"bytes"
	"github.com/bbva/qed/storage"
)
const keySize = 34
type SimpleCache struct {
	cached map[[keySize]byte][]byte
}
func NewSimpleCache(initialSize uint64) *SimpleCache {
	return &SimpleCache{make(map[[keySize]byte][]byte, initialSize)}
}
func (c SimpleCache) Get(key []byte) ([]byte, bool) {
	var k [keySize]byte
	copy(k[:], key)
	value, ok := c.cached[k]
	return value, ok
}
func (c *SimpleCache) Put(key []byte, value []byte) {
	var k [keySize]byte
	copy(k[:], key)
	c.cached[k] = value
}
func (c *SimpleCache) Fill(r storage.KVPairReader) (err error) {
	defer r.Close()
	for {
		entries := make([]*storage.KVPair, 100)
		n, err := r.Read(entries)
		if err != nil || n == 0 {
			break
		}
		for _, entry := range entries {
			if entry != nil {
				var key [keySize]byte
				copy(key[:], entry.Key)
				c.cached[key] = entry.Value
			}
		}
	}
	return nil
}
func (c SimpleCache) Size() int {
	return len(c.cached)
}