func FromString(s string) Digest {
	return Canonical.FromString(s)
}
FromString digests the input and returns a Digest.
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")
)
func Parse(s string) (Digest, error) {
	d := Digest(s)
	return d, d.Validate()
}
func FromReader(rd io.Reader) (Digest, error) {
	return Canonical.FromReader(rd)
}
func FromBytes(p []byte) Digest {
	return Canonical.FromBytes(p)
}