Created
July 10, 2019 15:12
-
-
Save belyaev-pa/0628c5c91fcd34a31d86cbec74a2e5f1 to your computer and use it in GitHub Desktop.
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
def mac_in_range(first_mac, last_mac, checking_mac): | |
first_int = int(first_mac.translate(None, ":.- "), 16) | |
last_int = int(last_mac.translate(None, ":.- "), 16) | |
checking_int = int(checking_mac.translate(None, ":.- "), 16) | |
if checking_int > first_int and checking_int < last_int: | |
return True | |
else: | |
return False | |
print(mac_in_range('02:50:68:00:00:02', '02:50:68:00:00:FF', '02:50:68:00:00:14')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment