Skip to content

Instantly share code, notes, and snippets.

@lawvs
Last active July 19, 2018 06:32
Show Gist options
  • Save lawvs/129b5c0b047f0cbf4e9697323b1fdfbe to your computer and use it in GitHub Desktop.
Save lawvs/129b5c0b047f0cbf4e9697323b1fdfbe to your computer and use it in GitHub Desktop.
Guess number
#!/usr/bin/env python3
import sys
import zlib
# from binascii import crc32
ans = int(sys.argv[1], 16)
for i in range(100000, 999999):
if i % 100000 == 0:
print('cracking',i)
if zlib.crc32(bytes(str(i), encoding='utf8')) == ans:
print('success', i)
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment