func TruncateID(id string) string {
	if i := strings.IndexRune(id, ':'); i >= 0 {
		id = id[i+1:]
	}
	trimTo := shortLen
	if len(id) < shortLen {
		trimTo = len(id)
	}
	return id[:trimTo]
}
TruncateID returns a shorthand version of a string identifier for convenience.
A collision with other shorthands is very unlikely, but possible.
In case of a collision a lookup with TruncIndex.Get() will fail, and the caller
will need to use a langer prefix, or the full-length Id.
package stringid
import (
	"crypto/rand"
	"encoding/hex"
	"io"
	"regexp"
	"strconv"
	"strings"
	"github.com/docker/docker/pkg/random"
)
const shortLen = 12
var validShortID = regexp.MustCompile("^[a-z0-9]{12}$")
func IsShortID(id string) bool {
	return validShortID.MatchString(id)
}