What\'s the most efficient way to convert an md5 hash to a unique integer to perform a modulus operation?
Since the solution language was not specified, Python is used for this example.
import os import hashlib array = os.urandom(1 << 20) md5 = hashlib.md5() md5.update(array) digest = md5.hexdigest() number = int(digest, 16) print(number % YOUR_NUMBER)