From e2a59daabc352c741790c9d1b481289daea80bd1 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 19 Mar 2026 13:37:26 -1000 Subject: [PATCH] Add SplitMix32 references for reviewers --- esphome/core/helpers.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/esphome/core/helpers.cpp b/esphome/core/helpers.cpp index dc8e865d78..1b6f8caf71 100644 --- a/esphome/core/helpers.cpp +++ b/esphome/core/helpers.cpp @@ -156,8 +156,11 @@ uint32_t fnv1_hash(const char *str) { return hash; } -// SplitMix32 PRNG — MurmurHash3 finalizer with golden-ratio increment. -// Provides fast, uniform, non-cryptographic random numbers. +// SplitMix32 — a fast, non-cryptographic PRNG from the SplitMix family +// (Steele et al., 2014). Uses a Weyl sequence with golden-ratio increment +// and the MurmurHash3 32-bit finalizer as output mixing function. +// Reference: https://doi.org/10.1145/2714064.2660195 +// Test results: https://lemire.me/blog/2017/08/22/testing-non-cryptographic-random-number-generators-my-results/ // Seeded lazily from the platform's secure RNG via random_bytes(). // ESP8266 uses os_random() instead (defined in esp8266/helpers.cpp). #ifndef USE_ESP8266