0

So I was supposed to use hash some co-ordinates and I was supposed to use k 3-wise independent hash functions in order for the mathematical explanations behind that algorithm to be hold. But after using k 3 wise independent hash functions, I got kinda bad accuracy(I used tabulation hashing which I myself wrote for this. Then I decided to use some cryptographic hash function for collision resistance and ended up using sha256 in this way

  • As I have to generate k different hash functions for my purpose, I generated k different seeds and wrote this snippet -
hex_num = hashlib.sha256((str(self.seed[i])+str(d)).encode('utf-8')).hexdigest()
                int_hex = int(hex_num[:5],16)
                index = int_hex % self.width

where I want to get the hashed values in the range of 0 to self.width-1. Now I had a few questions-

0 Answers0