How can you easily generate multiple hashes for the same element? — Double hashing. This method gives you as many hashes as you need: hash(x,m) = (hasha(x) + i * hashb(x)) mod m In Python: import mmh3 mmh3.hash64('foo') # two 64 bit signed ints, in a tuple now you have 2 64-bit hashes. Substituting for i gives you multiple hashes for a Bloom filter.
G
1.2K
Google Interview
This flashcard deck made by jwasham contains knowledge about google interview. For more details, please follow https://github.com/jwasham/google-interview-university