Daniel, this was just for convenience. While it is possible to have tons of hash functions, you only need a few of them. The real case with the k parameter is that you need to calculate the optimal value of it based on the error rate you would like to achieve.
Most of the times k > len(hasnFuncs) so you need to feed the item in all functions k times in a predictable manner.
That means you have to create a function with no side-effects that get a byte array parameter, hashes k times with the hasnFuncs and returns an integer for the position.
Daniel, this was just for convenience. While it is possible to have tons of hash functions, you only need a few of them. The real case with the
k
parameter is that you need to calculate the optimal value of it based on the error rate you would like to achieve.Most of the times
k > len(hasnFuncs)
so you need to feed the item in all functionsk
times in a predictable manner.That means you have to create a function with no side-effects that get a byte array parameter, hashes k times with the hasnFuncs and returns an integer for the position.
Thanks Theofanis, makes sense!