본문 바로가기

Web_Application/python

python md5 사용법



import hashlib

for index in range(100):

# hash = hashlib.md5(index).hexdigest()
# hash = hashlib.md5("{0}".format(index)).hexdigest()

hash = hashlib.md5(("{0}".format(index)).encode("utf-8")).hexdigest()

print("{0} = {1}".format(index, hash))

pyfiddle link :
https://pyfiddle.io/fiddle/ee1edabd-f51b-44b0-a7ff-7b833d467b4f/?m=Saved%20fiddle