Laboratory #3 IT Systems Security Lab University of Petroleum and Energy Studies, Dehradun
Laboratory #3 IT Systems Security Lab University of Petroleum and Energy Studies, Dehradun
Question #4:[5 Marks][Python/Window][Network Programming]: Write a program to convert Host byte order to
network byte order and vice versa. (Without use of struct.pack( ), socket.htonl( ),htons( ) or any in-build function)
Menu:
1. Convert Host byte order to Network byte order.
2. Convert Network byte order to Host byte order.
3. Exit.
Enter your choice: 1
Enter data in host byte order:123
Network byte order is: '\x01\x00\x02\x00\x03\x00\x00\x00'
Enter your choice:
_______________________________________________________________________________________________