int digit_analysis(const std::string &key, int tableSize)
{
if (keystr.length() < 6)
{
std::cerr << "Key string is too short to extract digits 3 to 6." << std::endl;
return 0;
}
long long keyValue = std::stoll(key);
std::string keystr = std::(newValue);
std::string backwardDigit = keystr.substr(2,4);
std::reverse(backwardDigit.begin(), backwardDigit.end());
int hash = std::stoi(backwardDigit);
return hash % tableSize;
}
how does this look?