func (b *GCSBuilder) SetM(m uint64) *GCSBuilder {
	if b.err != nil {
		return b
	}
	if m > uint64(math.MaxUint32) {
		b.err = gcs.ErrPTooBig
		return b
	}
	b.m = m
	return b
}
SetM sets the filter's modulous value after calling Builder().
package builder
import (
	"crypto/rand"
	"fmt"
	"math"
	"github.com/soteria-dag/soterd/chaincfg/chainhash"
	"github.com/soteria-dag/soterd/txscript"
	"github.com/soteria-dag/soterd/wire"
	"github.com/soteria-dag/soterd/soterutil/gcs"
)
const (
	DefaultP = 19
	DefaultM uint64 = 784931
)
type GCSBuilder struct {
	p uint8
	m uint64
	key [gcs.KeySize]byte
	data map[string]struct{}
	err  error
}
func RandomKey() ([gcs.KeySize]byte, error) {
	var key [gcs.KeySize]byte
	randKey := make([]byte, gcs.KeySize)
	_, err := rand.Read(randKey)
	if err != nil {
		return key, err
	}
	copy(key[:], randKey[:])
	return key, nil
}
func DeriveKey(keyHash *chainhash.Hash) [gcs.KeySize]byte {
	var key [gcs.KeySize]byte
	copy(key[:], keyHash.CloneBytes()[:])
	return key
}
func (b *GCSBuilder) Key() ([gcs.KeySize]byte, error) {
	if b.err != nil {
		return [gcs.KeySize]byte{}, b.err
	}
	return b.key, nil
}
func (b *GCSBuilder) SetKey(key [gcs.KeySize]byte) *GCSBuilder {
	if b.err != nil {
		return b
	}
	copy(b.key[:], key[:])
	return b
}
func (b *GCSBuilder) SetKeyFromHash(keyHash *chainhash.Hash) *GCSBuilder {
	if b.err != nil {
		return b
	}
	return b.SetKey(DeriveKey(keyHash))
}
func (b *GCSBuilder) SetP(p uint8) *GCSBuilder {
	if b.err != nil {
		return b
	}
	if p > 32 {
		b.err = gcs.ErrPTooBig
		return b
	}
	b.p = p
	return b
}