GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gccrs

gccrs: Fix fnv128 calculation

Corrects a precedence bug in the FNV-128 hash calculation.

This commit rectifies a bug in gccrs’s FNV-128 hash calculation logic. The FNV::write function contained a precedence error when applying prime128Shift and did not effectively utilize prime128Lower fitting into a uint32_t. The fix refines the calculation to ensure correct hashing.

In Details

The util/fnv-hash.h header file was updated to correct a calculation bug in the FNV::write method for FNV-128 hashing. The issue involved operator precedence with prime128Shift and suboptimal use of prime128Lower when it fits within a uint32_t.

For Context
FNV hash
A non-cryptographic hash function known for its speed and simplicity. FNV-128 is a variant producing a 128-bit hash value.
uint32_t
An unsigned integer type that is guaranteed to be at least 32 bits wide.
Filed Under: rustcompilerhashingbugfix