Expand description
Hash functions that must match their Java counterparts bit for bit.
Map records place child entries by a hash of the entry name, so reading
a map requires reproducing the exact hash the Java implementation used
when the map was written: java.lang.String::hashCode (computed over
UTF-16 code units with wrapping 32-bit arithmetic) scrambled by the
constants from MapRecord.
Functions§
- compare_
utf16_ strings - Compares two strings the way
java.lang.String::compareTodoes: by UTF-16 code units. This differs from Rust’sstrordering for supplementary characters, which sort after the basic multilingual plane in Rust but between U+D7FF and U+E000 (as surrogates) in Java. Map leaf entries and template properties are ordered this way on disk. - map_
entry_ hash - Computes the hash under which a map record stores the entry named
name, matchingMapRecord.getHash:(name.hashCode() ^ M) * M + A. - utf16_
string_ hash - Computes
java.lang.String::hashCodefortext.