The device IDs should be treated as a globally unique identifier. You can’t shorten them, as they are not allocated sequentially and there are no bits in common across all allocated device IDs.
You may find a number of bits in common in any group of devices, but which bits are in common is not constant across all devices.