Skip to content

Instantly share code, notes, and snippets.

@msabwat
Created October 21, 2018 21:04
Show Gist options
  • Save msabwat/33936df4925b485e419fe5e944598f9c to your computer and use it in GitHub Desktop.
Save msabwat/33936df4925b485e419fe5e944598f9c to your computer and use it in GitHub Desktop.
import hashlib
s = ""
start = 0
end = 0xFFFFFF
i = 0
import string
import random
def id_generator(size=random.randint(10,30), chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
while 42:
x = id_generator()
s = hashlib.md5(x+"Shrewk").hexdigest()
i = 2
if (s[0] == '0' and s[1]=='e'):
while(i < len(s) and s[i].isdigit()):
i += 1
if (i == len(s)):
print(s)
break
else:
print("Not a digit " + s + " " +s[i])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment