Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Python version of https://gist.github.com/almirsarajcic/4664387
def convert_id(id):
if len(id) == 17:
converted = int(id[3:]) - 61197960265728
else:
converted = '765' + str(int(id) + 61197960265728)
return str(converted)
sixty_four = "76561197992765754"
thirty_two = "32500026"
print(convert_id(thirty_two) == sixty_four) # True
print(convert_id(sixty_four) == thirty_two) # True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment