]> git.kaiwu.me - nginx.git/commit
Switched $request_id to SipHash-based generation
authorEugene Grebenschikov <e.grebenshchikov@f5.com>
Thu, 21 May 2026 17:38:47 +0000 (10:38 -0700)
committerEugene <54681898+jimf5@users.noreply.github.com>
Tue, 2 Jun 2026 22:30:30 +0000 (15:30 -0700)
commitc5f2afd50e63c94f3696d2d18bdd79ac70643eec
tree2f50811f9d7df5eb52d0b263dd25587840c96dea
parent6067896f031491d8e075f9950baab7763b9ac70f
Switched $request_id to SipHash-based generation

Replaced RAND_bytes() and random() based $request_id
generation with SipHash-2-4.  The previous implementation
used RAND_bytes() when built with OpenSSL, which is
50-100x slower than needed for a non-security identifier,
and fell back to random() which produces poor 128-bit
random numbers.

The new implementation calls SipHash twice with a secret
key and a monotonic counter, producing 128 bits with good
statistical distribution at a fraction of the cost.
src/http/ngx_http_variables.c