func (d *Digest) Checksums() Checksums {
	return Checksums{
		MD5:       d.md5.Sum(nil),
		CRC32C:    int32(d.crc32c.Sum32()),
		HasCRC32C: true,
	}
}
Checksums returns a new Checksums variable with the calculated hash values.
package checksums
import (
	"crypto/md5"
	"hash"
	"hash/crc32"
	"io"
	"sync"
)
var crc32cTable *crc32.Table
var tableInitOnce = new(sync.Once)
type Digest struct {
	md5    hash.Hash
	crc32c hash.Hash32
}
var _ io.Writer = new(Digest)
func NewDigest() *Digest {
	tableInitOnce.Do(func() { crc32cTable = crc32.MakeTable(crc32.Castagnoli) })
	return &Digest{
		md5:    md5.New(),
		crc32c: crc32.New(crc32cTable),
	}
}
func (d *Digest) Write(p []byte) (int, error) {
	d.crc32c.Write(p)
	d.md5.Write(p)
	return len(p), nil
}
func (d *Digest) Reset() {
	d.md5.Reset()
	d.crc32c.Reset()
}