Created
November 8, 2023 01:39
-
-
Save csrutil/8cbfd2002ad812103fff370a198f3a04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## https://www.zhihu.com/question/424089478 | |
import hashlib | |
def getpwd(uid): | |
uid = bytearray.fromhex(uid) | |
h = bytearray.fromhex(hashlib.sha1(uid).hexdigest()) | |
pwd = "" | |
pwd += "%02X" % h[h[0] % 20] | |
pwd += "%02X" % h[(h[0] + 5) % 20] | |
pwd += "%02X" % h[(h[0] + 13) % 20] | |
pwd += "%02X" % h[(h[0] + 17) % 20] | |
return pwd | |
print(getpwd("这里输入14位卡号")) | |
# hf mfu wrbl b 8 d 00000000 k 这里输8位密码 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment