From Sexy Anoa, 1 Week ago, written in Plain Text.
  1. #!/bin/python
  2. import hashlib
  3.  
  4. def calc(str):
  5.   m = hashlib.md5()
  6.   m.update(str)
  7.   m.digest()
  8.   return m.hexdigest()
  9.  
  10. def generateStrings(charSet,maxLength,string = ''):
  11.   temp = [string]
  12.   if len(string) < maxLength:
  13.     for char in charSet:
  14.       temp += generateStrings(charSet,maxLength,string + char)
  15.   return temp
  16.  
  17. def calcArray(array):
  18.   sets = ["'" + string + "','" + calc(string) + "'" for string in array]
  19.   return 'INSERT IGNORE INTO md5 (str,md5) VALUES(' + '),('.join(sets) + ');'
  20.  
  21. print calcArray(generateStrings('0123456789',6))
captcha