The MTProto documentation says, referring to the unique msg_id
:
to counter replay-attacks the lower 32 bits of msg_id passed by the client must not be empty and must present a fractional part of the time point when the message was created
When it comes to bit operations I feel like I'm dumb, so what would be the "way" to ensure the lower 32 bits are never empty?
Also, I don't completely understand
a fractional part of the time ...
What it is trying to say here is that unix time is standardised to go down to the second, a fractional part of the time here is a fraction of a second. You ensure the lower 32-bits are never empty by using a time source more accurate than standard Unix time (preferably nanoseconds but milliseconds work too) that can provide accurate data for the lower 32-bits.