func Parse(s string) (Digest, error) {
	d := Digest(s)
	return d, d.Validate()
}
Parse parses s and returns the validated digest object. An error will
be returned if the format is invalid.
package digest
import (
	"fmt"
	"hash"
	"io"
	"regexp"
	"strings"
)
type Digest string
func NewDigest(alg Algorithm, h hash.Hash) Digest {
	return NewDigestFromBytes(alg, h.Sum(nil))
}
func NewDigestFromBytes(alg Algorithm, p []byte) Digest {
	return Digest(fmt.Sprintf("%s:%x", alg, p))
}
func NewDigestFromHex(alg, hex string) Digest {
	return Digest(fmt.Sprintf("%s:%s", alg, hex))
}
var DigestRegexp = regexp.MustCompile(`[a-zA-Z0-9-_+.]+:[a-fA-F0-9]+`)
var DigestRegexpAnchored = regexp.MustCompile(`^` + DigestRegexp.String() + `$`)
var (
	ErrDigestInvalidFormat = fmt.Errorf("invalid checksum digest format")
	ErrDigestInvalidLength = fmt.Errorf("invalid checksum digest length")
	ErrDigestUnsupported = fmt.Errorf("unsupported digest algorithm")
)