Skip to main content

java_string_hash

Function java_string_hash 

Source
pub fn java_string_hash(key: &str) -> u32
Expand description

Bit-for-bit port of String.hashCode() & Integer.MAX_VALUE. Iterates over UTF-16 code units (matching Java’s char) so non-BMP code points hash identically to the JDK. ASCII strings short-circuit through the byte path.

Used by JavaStringHashHasher.