Then, just use thread ID and integer sequence pairs instead of trying to stuff them into an arbitrary binary format.
Thread IDs get repeated across reboots. Integer sequence may also repeat in a distributed scenario, unless you want a massive bottleneck. You do need other stuff (timestamps, random number, etc.).