Created
May 24, 2021 11:23
-
-
Save profiprog/cf608d80444013cea82cfb461252f62a to your computer and use it in GitHub Desktop.
One line code
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
ip2bin = lambda ip: ' '.join([bin(int(n))[2:].zfill(8) for n in ip.split(".")]) | |
bin2ip = lambda ip: '.'.join([str(int(n,2)) for n in ip.split(' ')]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment