You calculate the max_timestamp by this: `max_timestamp = 1 << (64 - datacenter_id_bits - worker_id_bits - sequence_id_bits)` You seem to have forgotten the timestamp can only be 41-bit.