I'm implementing an algorithm in Python3 (homework material) that uses multiple (k) hash functions. The hash functions must injective and return a value between [0,1].
Having a single hash function is easy. In How to hash strings into a float in [0:1]? there are some nice answers.
But the problem is I need k-different hash functions, and the question is regarding a single hash. It doesn't have to be truly random of course, just random in [0,1].
Aucun commentaire:
Enregistrer un commentaire