shorten the generic identifier

make it long enough that it's unlikely to have two identical
ones randomly connected to the same machine

but short enough that it's likely/conceivable to have a collision
This commit is contained in:
bunnie 2025-11-06 14:08:48 +08:00
parent 2d7ee0c614
commit 12d0728582

View file

@ -42,7 +42,10 @@ pub fn derive_usb_serial_number(
} as u32)
.unwrap_or('.');
ret.push(c);
if ret.len() == 8 {
// long enough such that it's unlikely that two devices on one computer will have the same ID
// short enough that it's likely to have a collision if used as a global UUID to fingerprint
// devices
if ret.len() == 6 {
break;
}
}