> 8 bytes * 400 million phone numbers < 3 terabytes of data
I get 3.2GB, which fits in RAM.
So yes, I guess, but why hit the disk at all? I'd probably just sort the data and do a binary search.
I get 3.2GB, which fits in RAM.
So yes, I guess, but why hit the disk at all? I'd probably just sort the data and do a binary search.
An easy way is to take a 32 to 32 bit hash (eg. http://stackoverflow.com/a/12996028/1763356), calculate
hash(top 32 bits) ^ hash(bottom 32 bits)
and take the bottom 29 bits of that. I wouldn't be surprised if you can do this in less time than an integer division.