Created
November 23, 2014 19:29
-
-
Save nmcv/3dcfa0e9892d037338c9 to your computer and use it in GitHub Desktop.
Test if L3 is L3 XOR {1} in the other case. H/W 1.
This file contains 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
#!/usr/bin/env python3 | |
import itertools | |
import string | |
from pprint import pprint | |
from binascii import unhexlify, hexlify | |
def cmp(a, b): | |
xored_b = ''.join(['{:02x}'.format(b ^ 0xFF) for b in unhexlify(b)]) | |
if a == xored_b: | |
print('{}:{} matches'.format(a, b)) | |
else: | |
print('{}:{} x '.format(a, b)) | |
def main(): | |
cmp('29634d75', '8d91d162') | |
cmp('25b14856', '107f0959') | |
cmp('6d4e0fdc', '92b1f023') | |
cmp('c3c36462', '3c3c9b9d') | |
cmp('fc617adb', '260568f5') | |
cmp('3a894ef6', '86d11f43') | |
cmp('ddd87290', '22278d6f') | |
cmp('91612be2', '6e9ed41d') | |
cmp('9ef66c9f', '60692649') | |
cmp('fb3549e8', 'a9a871d5') | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: