func GetZeroUUID() UUIDType {
	resUUID := UUIDType{}
	for i := 0; i < BytesPerUUID; i++ {
		resUUID[i] = 0
	}
	return resUUID
}
GetEmptyUUID returns a UUID with all zeros
package prospector
import (
	"encoding/hex"
	"errors"
	"fmt"
)
type UUIDType [BytesPerUUID]byte
const BytePerTreeLevel = 4
const BytesForMajorComponents = 8
const BytesPerUUID = 16
type UUIDs []UUIDType
func (slice UUIDs) Len() int {
	return len(slice)
}
func (slice UUIDs) Less(i, j int) bool {
	ind := 0
	for ; ind < BytesPerUUID && slice[i][ind] == slice[j][ind]; ind++ {
	}
	if ind < BytesPerUUID && slice[i][ind] < slice[j][ind] {
		return true
	}
	return false
}
func (slice UUIDs) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}
func (uuid1 *UUIDType) BytesDiffer(uuid2 *UUIDType) int {
	if uuid2 == nil {
		return len(uuid1)
	}
	diffLen := len(uuid1)
	for index, element := range uuid1 {
		if uuid2[index] != element {
			break
		}
		diffLen--
	}
	return diffLen
}
func (uuid1 *UUIDType) IsIdenticalTo(uuid2 *UUIDType) bool {
	if uuid1.BytesDiffer(uuid2) == 0 {
		return true
	}
	return false
}
func (uuid1 *UUIDType) HasTheSameMajorParts(uuid2 *UUIDType) bool {
	if uuid1.BytesDiffer(uuid2) <= BytesForMajorComponents {
		return true
	}
	return false
}
func GetUUID(deviceTreeJSON []byte) (UUIDType, error) {
	devTree, err := NewDeviceTree(deviceTreeJSON, "json")
	if err != nil {
		return UUIDType{}, errors.New("Failed to load and parse JSON for the device tree")
	}
	resUUID, err := devTree.GetUUID()
	if err != nil {
		return UUIDType{}, fmt.Errorf("Failed to assign an UUID for device tree %v", deviceTreeJSON)
	}
	return resUUID, nil
}
func (u *UUIDType) ToHexString() string {
	return hex.EncodeToString(u[:])
}
func UUIDTypeFromHexString(b []byte) (*UUIDType, error) {
	uuid := new(UUIDType)
	if n, err := hex.Decode(uuid[:], b); err != nil {
		return nil, err
	} else if n != BytesPerUUID {
		return nil, fmt.Errorf("Failed to decode BytesPerUUID:%i bytes from input", BytesPerUUID)
	}
	return uuid, nil
}
func (u *UUIDType) ToString() string {
	uuid := make([]byte, 16)
	j := 0
	var offest byte = 0
	for i := range uuid {
		uuid[i] = u[j] + offest
		if j == BytesForMajorComponents-1 {
			j = 0
			offest += 55
		} else {
			j++
		}
	}
	return string(UUIDFromBytes(uuid))
}
func UUIDFromBytes(u []byte) string {
	var offsets = [...]int{0, 2, 4, 6, 9, 11, 14, 16, 19, 21, 24, 26, 28, 30, 32, 34}
	const hexString = "0123456789abcdef"
	r := make([]byte, 36)
	for i, b := range u {
		r[offsets[i]] = hexString[b>>4]
		r[offsets[i]+1] = hexString[b&0xF]
	}
	r[8] = '-'
	r[13] = '-'
	r[18] = '-'
	r[23] = '-'
	return string(r)
}