code: func ShortCodeTable(dst *Set, length int) map[digest.Digest]string {
  	dst.mutex.RLock()
  	defer dst.mutex.RUnlock()
  	m := make(map[digest.Digest]string, len(dst.entries))
  	l := length
  	resetIdx := 0
  	for i := 0; i < len(dst.entries); i++ {
  		var short string
  		extended := true
  		for extended {
  			extended = false
  			if len(dst.entries[i].val) <= l {
  				short = dst.entries[i].digest.String()
  			} else {
  				short = dst.entries[i].val[:l]
  				for j := i + 1; j < len(dst.entries); j++ {
  					if checkShortMatch(dst.entries[j].alg, dst.entries[j].val, "", short) {
  						if j > resetIdx {
  							resetIdx = j
  						}
  						extended = true
  					} else {
  						break
  					}
  				}
  				if extended {
  					l++
  				}
  			}
  		}
  		m[dst.entries[i].digest] = short
  		if i >= resetIdx {
  			l = length
  		}
  	}
  	return m
  }
docs: // ShortCodeTable returns a map of Digest to unique short codes. The
  // length represents the minimum value, the maximum length may be the
  // entire value of digest if uniqueness cannot be achieved without the
  // full value. This function will attempt to make short codes as short
  // as possible to be unique.