hashStrToInt function
Hashes a string to an integer in the range (0, max)
Implementation
int hashStrToInt(String input, {int max = 100000}) {
final hash = input.codeUnits.fold(
0,
(prev, elem) => (prev * 31 + elem) & 0x7FFFFFFF,
);
return hash % max;
}