--

Hello,

Thanks for the feedback.

> meaning that for a given input value it must always generate the same hash value

That's a requirement for any hash function: it should return the same hash code across multiple invocations on the same object/value. As for the RNG result/object address used by JS engines as an object hash, it's cached in the object header, so subsequent invocations return the cached hash code.

The discussed hash table algorithm is called deterministic because, unlike vast majority of other hash table algorithms, it preserves the insertion order when iterating through the map.

--

--

Andrey Pechkurov
Andrey Pechkurov

Written by Andrey Pechkurov

Core database engineer at QuestDB. Distributed systems gazer. Node.js contributor. Occasional tech blogger and speaker.

Responses (1)