Created
October 17, 2020 05:58
-
-
Save akionsight/6e4148bd52d315a00daecd070d4f4f28 to your computer and use it in GitHub Desktop.
secrets.compare_digest exaample
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
import secrets | |
equal_str = '9oKOSmTqT8Kn2BnpZ7qIs7JjTleGeXa119rMfxFdoDg5zeqInGT5NMWK_y0mI2U_ldbFaiSnsfDtwMSiBGvaKCvBL7wnXkW' | |
unequeal_str = '74K2Xps1O2om5ujSWxtgq449D4_RmHGSqH2HIJgM_m4YclfhxR0LHJTtnt-9obVC8gJOXLrCzVL63OuK6Qc_BcLJioNPm4Yjz' | |
print(secrets.compare_digest(equal_str, equeal_str)) ## True | |
print(secrets.compare_digest(equal_str, unequeal_str)) ## False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment