export function bytesToUuid(bytes: number[] | Uint8Array): string { const bits = [...bytes].map((bit) => { const s = bit.toString(16); return bit < 0x10 ? "0" + s : s; }); return [ ...bits.slice(0, 4), "-", ...bits.slice(4, 6), "-", ...bits.slice(6, 8), "-", ...bits.slice(8, 10), "-", ...bits.slice(10, 16), ].join("");}
export function uuidToBytes(uuid: string): number[] { const bytes: number[] = [];
uuid.replace(/[a-fA-F0-9]{2}/g, (hex: string): string => { bytes.push(parseInt(hex, 16)); return ""; });
return bytes;}