Fixes an approximation problem when generating random ticks.
The previous implementation of the random ticks generation algorithm
converted the number of ticks into a positive one by removing its sign,
after it had been reduced to the specified range.
This approximation caused the loss of 1 bit from the original 64 bit number,
which invalidated the final result.
Adds support for generating random dates within a range.