I was looking at the salt values in the -wal and -shm files, and got confused
of their endianness.

the -wal is always big endian, this is a -wal hexdump:
0000000    7f37    8206    2d00    18e2    0000    0010    0000    0000
0000010    a631    f202    c1e0    fdc7    e9c6    44a9    997c    c942
0000020    0000    0100    0000    0000    a631    f202    c1e0    fdc7

That's 0xa631f202 for salt1 bytes.

and the corresponding -shm file (on a little endian machine) has:
0000000    e218    002d    0000    0000    0002    0000    0001    1000
0000010    0008    0000    0006    0000    5a2c    cbbc    3055    df6c
0000020    a631    f202    c1e0    fdc7    926a    eeff    6afc    ebb3

Which is the same byte squence for salt1.

According to the docs at https://sqlite.org/walformat.html section "2.1. The
WAL-Index Header":

    "Individual fields of the shm header are all unsigned integers in the
    native byte-order of the host machine"

So I guess that's not true for the salt1 and salt2 values? They are to be
interpreted as either bigendian?

sqlite-users mailing list

Reply via email to