Popular recipes tagged "byte_order"http://code.activestate.com/recipes/tags/byte_order/2008-08-15T14:03:30-07:00ActiveState Code RecipesReverse the byte order of an unsigned 'int' or 'long' number in Python (Python) 2008-08-15T14:03:30-07:00Vishal Saprehttp://code.activestate.com/recipes/users/4166412/http://code.activestate.com/recipes/576421-reverse-the-byte-order-of-an-unsigned-int-or-long-/ <p style="color: grey"> Python recipe 576421 by <a href="/recipes/users/4166412/">Vishal Sapre</a> (<a href="/recipes/tags/byte_order/">byte_order</a>, <a href="/recipes/tags/byte_order_reversal/">byte_order_reversal</a>, <a href="/recipes/tags/reverse/">reverse</a>, <a href="/recipes/tags/swap_byte_order/">swap_byte_order</a>). Revision 5. </p> <p>Given an unsigned number, of type 'int' or 'long', this function returns a corresponding number of the same type, with its byte order reversed. So if input = 0xABCDEF, then output = 0xEFCDAB</p>