Hashing algorithm for G'MIC?

I been thinking of yet another time when I plan to use hashmap again. Now, this time to generate random non-existent colors. I did an approach where I used dynamic array and sorting and placing new color, but realized it would be way better and shorter with hashmap. Now, getting tired of having to copy and paste bad, but working hashing algorithm. I would like to see hashing function in G’MIC, especially with seed.

1 Like

You have my vote! Admittedly I haven’t often needed it, but some algorithms I didn’t bother trying due to lack of it.

@David_Tschumperle Sounds like two of us would like hashing functions on G’MIC.

It’s not that hard to create hash table. A little tricky. I made rep_val2order, rep_mode, and rep_mode_blend which all use hash table and hashmap. Very much like single dictionary/set.