Problem: I want to divide the M strings into N bucket as uniformly as possible.
One solution I was thinking is,
- Create a hash of string
- Convert the hash to integer by mapping ascii value of each character in hash
- Sum up those ascii values
- Divide the sum by N
Uniform distribution I believe will be solved by hashing but not sure converting to ascii will change anything.
Please suggest better solution if you have one.
Thank you in advance