';
html += `
UUID: ${formatted}
`;
html += `
Version: ${version}
`;
html += `
Variant: ${variant}
`;
if (version === 1) {
const ts = (timeInt - 0x01b21dd213814000) / 10000;
const date = new Date(ts);
html += `
Timestamp: ${date.toUTCString()}
`;
const clockSeq = ((parseInt(hex[16], 16) & 0x3F) << 8) | parseInt(hex[18] + hex[19], 16);
html += `
Clock Sequence: ${clockSeq}
`;
html += `
Node (MAC): ${nodeHex.toUpperCase()}
`;
}
if (version === 2) {
html += `
Note: DCE Security UUID — limited decoding available.
`;
}
if (version === 6) {
const ts = (timeInt - 0x01b21dd213814000) / 10000;
const date = new Date(ts);
html += `
Timestamp: ${date.toUTCString()}
`;
}
if (version === 7) {
const tsMs = timeInt >>> 16;
const date = new Date(tsMs);
html += `
Timestamp: ${date.toUTCString()} (${tsMs} ms)
`;
const randA = parseInt(hex.substring(16, 20), 16);
const randB = hex.substring(20, 32);
html += `
Random: ${randA.toString(16).padStart(4,'0')}-${randB}
`;
}
if (version === 8) {
html += `
Note: Custom/vendor-specific UUID format.
`;
}
html += '
';
return { html };
}
function update() {
const val = input.value.trim();
if (!val) { output.innerHTML = ''; return; }
const result = decodeUUID(val);
if (result.error) {
output.innerHTML = `