func (s *Coffer) View() (*Buffer, error) {
	if s.Destroyed() {
		return nil, ErrCofferExpired
	}
	b, _ := NewBuffer(32)
	s.RLock()
	defer s.RUnlock()
	h := Hash(s.right.Data())
	for i := range b.Data() {
		b.Data()[i] = h[i] ^ s.left.Data()[i]
	}
	Wipe(h)
	return b, nil
}
/*
View returns a snapshot of the contents of a Coffer inside a Buffer. As usual the Buffer should be destroyed as soon as possible after use by calling the Destroy method.
package core
import (
	"errors"
	"sync"
	"time"
)
const interval = 500 * time.Millisecond
var ErrCofferExpired = errors.New("<memguard::core::ErrCofferExpired> attempted usage of destroyed key object")
type Coffer struct {
	sync.RWMutex
	left  *Buffer  
	right *Buffer  
	rand *Buffer  
}
func NewCoffer() *Coffer {
	s := new(Coffer)
	s.left, _ = NewBuffer(32)
	s.right, _ = NewBuffer(32)
	s.rand, _ = NewBuffer(32)
	s.Initialise()
	go func(s *Coffer) {
		for {
			time.Sleep(interval)
			if err := s.Rekey(); err != nil {
				break
			}
		}
	}(s)
	return s
}
func (s *Coffer) Initialise() error {
	if s.Destroyed() {
		return ErrCofferExpired
	}
	if err := s.initialise(); err != nil {
		Panic(err)
	}
	return nil
}
func (s *Coffer) initialise() error {
	s.Lock()
	defer s.Unlock()
	if err := Scramble(s.left.Data()); err != nil {
		return err
	}
	if err := Scramble(s.right.Data()); err != nil {
		return err
	}
	hr := Hash(s.right.Data())
	for i := range hr {
		s.left.Data()[i] ^= hr[i]
	}
	Wipe(hr)
	return nil
}