Ensuring randomness is provided for unique generation of shortlinks