Issue #13703: add a way to randomize the hash values of basic types (str, bytes, datetime)
in order to make algorithmic complexity attacks on (e.g.) web apps much more complicated.
The environment variable PYTHONHASHSEED and the new command line flag -R control this
behavior.
diff --git a/Objects/object.c b/Objects/object.c
index ac57cd7..0b1c656 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -712,6 +712,8 @@
return -1;
}
+_Py_HashSecret_t _Py_HashSecret;
+
long
PyObject_Hash(PyObject *v)
{