From e6060a3355ce50768e12b7454641bf2bbc23e097 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 7 Sep 2017 12:30:49 -0700 Subject: [PATCH] reorder fields a bit --- pep-0552.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pep-0552.txt b/pep-0552.txt index f6035ca96..f09bfdc6f 100644 --- a/pep-0552.txt +++ b/pep-0552.txt @@ -60,12 +60,13 @@ version. One magic number will correspond to the current pyc format and the other to "hash-based" pycs introduced by this PEP. In hash-based pycs, the second field in the pyc header (currently the -"timestamp" field) will contain the SipHash_ (with a hardcoded key) of the -contents of the source file. Another a fast hash like MD5 or BLAKE2_ would also -work. We choose SipHash because Python already has a builtin implementation of -it from :pep:`456`. The third field in the pyc header (currently the "source -size" field) will become a bitset of flags. We define the lowest flag in this -bitset called ``check_source`` +"timestamp" field) will become a bitset of flags. We define the lowest flag in +this bitset called ``check_source``. Following the bitset is a 64-bit hash of +the source file. We will use a SipHash_ (with a hardcoded key) of the contents +of the source file. Another a fast hash like MD5 or BLAKE2_ would also work. We +choose SipHash because Python already has a builtin implementation of it from +:pep:`456`, although an interface that allows picking the SipHash key must be +exposed to Python. When Python encounters a hash-based pyc, its behavior depends on the setting of the ``check_source`` flag. If the ``check_source`` flag is set, Python will