Split Entire Hash Range Into n Equal Ranges

Posted by noxtion on Stack Overflow See other posts from Stack Overflow or by noxtion
Published on 2010-04-24T20:35:25Z Indexed on 2010/04/24 20:43 UTC
Read the original article Hit count: 167

Filed under:
|
|
|

Hello.

I am looking to take a hash range (md5 or sha1) and split it into n equal ranges.

For example, if n=5, the entire hash range would be split by 5 so that there would be a uniform distribution of key ranges. I would like n=1 to be from the beginning of the hash range to 1/5, 2 from 1/2 to 2/5, etc all the way to the end.

I am new to hashing and a little bit unsure of where I could start on solving this for a project. Any help you could give would be great.

© Stack Overflow or respective owner

Related posts about hashing

Related posts about sha1