Consistent hash implemented in lua