0

such as:

static void w_long(long x, WFILE *p)
{
    w_byte((char)( x      & 0xff), p);
    w_byte((char)((x>> 8) & 0xff), p);
    w_byte((char)((x>>16) & 0xff), p);
    w_byte((char)((x>>24) & 0xff), p);
}

And why the pyc file is unreadable, where is the const text/string ?

1 Answers1

1

& 0xff takes the last 8 bits (or one byte) from the number. That makes sure you write only one byte at a time to the file (and in that case, uses for little endian byte-order storing).

0xff is 1111 1111 in binary. Executing logical and with it will turn on all the bits that are 1 in x and are within the last 8 bits.


For example:

x = 0010 0100 1001 0111
                         &
              1111 1111
    -------------------
    0000 0000 1001 0111
Uriel
  • 15,579
  • 6
  • 25
  • 46