code: func calcDigest(inputs map[string][]byte) string {
  	keys := make([]string, 0, len(inputs))
  	for k := range inputs {
  		keys = append(keys, k)
  	}
  	sort.Strings(keys)
  	h := sha1.New()
  	for _, k := range keys {
  		v := inputs[k]
  		fmt.Fprintf(h, "%s\n%d\n", k, len(v))
  		h.Write(v)
  	}
  	blob := h.Sum(nil)
  	return hex.EncodeToString(blob[:])
  }
docs: // calcDigest produces a digest of a given map using some stable serialization.