code: func digestFromPath(digestPath string) (digest.Digest, error) {
  
  	digestPath = strings.TrimSuffix(digestPath, "/data")
  	dir, hex := path.Split(digestPath)
  	dir = path.Dir(dir)
  	dir, next := path.Split(dir)
  
  	// next is either the algorithm OR the first two characters in the hex string
  	var algo string
  	if next == hex[:2] {
  		algo = path.Base(dir)
  	} else {
  		algo = next
  	}
  
  	dgst := digest.NewDigestFromHex(algo, hex)
  	return dgst, dgst.Validate()
  }
docs: // Reconstructs a digest from a path