hashlib



In [2]:
import hashlib

In [9]:
hashes = [hashlib.md5(bytes(str(i),"utf-8")).hexdigest() for i in range(100000)]

In [10]:
sorted_hashes = sorted(hashes)

In [11]:
%timeit sorted_hashes


The slowest run took 63.99 times longer than the fastest. This could mean that an intermediate result is being cached.
10000000 loops, best of 3: 15.7 ns per loop

In [ ]: