func (id GID) Hex() string {
	return hex.EncodeToString(id)
}
Hex returns a hex representation of the GID.
package gid
import (
	"bytes"
	"crypto/md5"
	"crypto/rand"
	"encoding/binary"
	"encoding/hex"
	"fmt"
	"io"
	"net"
	"os"
	"sync/atomic"
	"time"
)
var (
	macID = func() []byte {
		var mac [3]byte
		ifaces, err := net.Interfaces()
		if err == nil {
			for _, iface := range ifaces {
				if iface.Flags&net.FlagUp != 0 && bytes.Compare(iface.HardwareAddr, nil) != 0 {
					md5hash := md5.New()
					md5hash.Write(iface.HardwareAddr)
					copy(mac[:], md5hash.Sum(nil))
					return mac[:]
				}
			}
		}
		_, err = io.ReadFull(rand.Reader, mac[:])
		if err != nil {
			panic("cannot grab an random string: " + err.Error())
		}
		return mac[:]
	}()
	gidCounter uint32
)
type GID []byte
func New() GID {
	var id [12]byte
	binary.BigEndian.PutUint32(id[:], uint32(time.Now().Unix()))
	id[4] = macID[0]
	id[5] = macID[1]
	id[6] = macID[2]
	pid := os.Getpid()
	id[7] = byte(pid >> 8)
	id[8] = byte(pid)
	i := atomic.AddUint32(&gidCounter, 1)
	id[9] = byte(i >> 16)
	id[10] = byte(i >> 8)
	id[11] = byte(i)
	return GID(id[:])
}
func NewWithTime(t time.Time) GID {
	var id [12]byte
	binary.BigEndian.PutUint32(id[:4], uint32(t.Unix()))
	return GID(id[:])
}
func (id GID) Valid() bool {
	return len(id) == 12
}