GOAL: Map every URL handled by a server to 0, 1, 2, or 3, distributing as uniformly as possible.
While the documentation for ruby\'s String#hash met
The easiest (and consistent) way may be this (and it's fast):
"https://www.example.com/abc/def/123?hij=345".sum % 4
That will always produce an integer 0 - 3, is quite fast, and should be fairly well distributed (though I haven't actually run tests on distribution).