func benchmarkSignature(b *testing.B, totalBytes int64) {
	b.SetBytes(totalBytes)
	for i := 0; i < b.N; i++ {
		src := io.LimitReader(rand.New(rand.NewSource(time.Now().UnixNano())), totalBytes)
		signature(b, src)
	}
}
Benchmarks generting a signature for a file totalBytes long.
package librsync
import (
	"bytes"
	"io"
	"math/rand"
	"testing"
	"time"
)