func lenErr(n int) error {
	switch n {
	case 2, 16:
		return nil
	}
	return fmt.Errorf("UUIDs must have length 2 or 16, got %d", n)
}
lenErr returns an error if n is an invalid UUID length.
package ble
import (
	"bytes"
	"encoding/binary"
	"encoding/hex"
	"fmt"
	"strings"
)
type UUID []byte
func UUID16(i uint16) UUID {
	b := make([]byte, 2)
	binary.LittleEndian.PutUint16(b, i)
	return UUID(b)
}
func Parse(s string) (UUID, error) {
	s = strings.Replace(s, "-", "", -1)
	b, err := hex.DecodeString(s)
	if err != nil {
		return nil, err
	}
	if err := lenErr(len(b)); err != nil {
		return nil, err
	}
	return UUID(Reverse(b)), nil
}
func MustParse(s string) UUID {
	u, err := Parse(s)
	if err != nil {
		panic(err)
	}
	return u
}