func ParseUUID128(s string) (UUID, error) {
	if len(s) != UUID128StringLength {
		return nil, fmt.Errorf("invalid UUID128: %s", s)
	}
	b := make([]byte, 16)
	off := 0
	for i := 0; i < 36; {
		switch i {
		case 8, 13, 18, 23:
			if s[i] != '-' {
				return nil, fmt.Errorf("invalid UUID128: %s", s)
			}
			i++
		default:
			u64, err := strconv.ParseUint(s[i:i+2], 16, 8)
			if err != nil {
				return nil, fmt.Errorf("invalid UUID128: %s", s)
			}
			b[off] = byte(u64)
			i += 2
			off++
		}
	}
	return UUID(reverse(b)), nil
}
ParseUUID128 parses a UUID string with the form:
01234567-89ab-cdef-0123-456789abcdef
package cbgo
import (
	"encoding/binary"
	"encoding/hex"
	"fmt"
	"strconv"
)
const UUID16StringLength = 4
const UUID128StringLength = 36
type UUID []byte
func reverse(bs []byte) []byte {
	c := make([]byte, len(bs))
	for i, b := range bs {
		c[len(c)-1-i] = b
	}
	return c
}
func UUID16(i uint16) UUID {
	b := make([]byte, 2)
	binary.LittleEndian.PutUint16(b, i)
	return UUID(b)
}
func UUID128(b []byte) (UUID, error) {
	if len(b) != 16 {
		return nil, fmt.Errorf("failed to construct UUID128: wrong length: have=%d want=16", len(b))
	}
	return UUID(b), nil
}
func ParseUUID16(s string) (UUID, error) {
	if len(s) != UUID16StringLength {
		return nil, fmt.Errorf("invalid UUID16: %s", s)
	}
	b, err := hex.DecodeString(s)
	if err != nil {
		return nil, fmt.Errorf("invald UUID16: %v", err)
	}
	return UUID(reverse(b)), nil
}