def swap16(value):
 return (((value & 255) << 8) | (value >> 8))

def swap16 ( value ) : return ( ( ( value & 255 ) << 8 ) | ( value >> 8 ) )
swap byte between big and little endian of a 16 bits integer .