func (s *KeyHasher) Salted(salt []byte, data ...[]byte) Digest {
	data = append(data, salt)
	return s.Do(data...)
}
Salted function adds a seed to the input data before hashing it.
package hashing
import (
	"crypto/sha256"
	"fmt"
	"hash"
	"golang.org/x/crypto/blake2b"
)
type Digest []byte
type Hasher interface {
	Salted([]byte, ...[]byte) Digest
	Do(...[]byte) Digest
	Len() uint16
}
type XorHasher struct{}
func NewXorHasher() Hasher {
	return new(XorHasher)
}
func (x XorHasher) Salted(salt []byte, data ...[]byte) Digest {
	data = append(data, salt)
	return x.Do(data...)
}
func (x XorHasher) Do(data ...[]byte) Digest {
	var result byte
	for _, elem := range data {
		var sum byte
		for _, b := range elem {
			sum = sum ^ b
		}
		result = result ^ sum
	}
	return []byte{result}
}
func (s XorHasher) Len() uint16 { return uint16(8) }
type KeyHasher struct {
	underlying hash.Hash
}
func NewBlake2bHasher() Hasher {
	hasher, err := blake2b.New256(nil)
	if err != nil {
		panic(fmt.Sprintf("Error creating BLAKE2b hasher %v", err))
	}
	return &KeyHasher{underlying: hasher}
}
func NewSha256Hasher() Hasher {
	return &KeyHasher{underlying: sha256.New()}
}