Stopped counting the bits from the wrong side. 🤦

This commit is contained in:
tastytea 2018-12-26 22:35:04 +01:00
parent eaffd0b005
commit 55457923d0
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 3 additions and 2 deletions

View File

@ -69,10 +69,11 @@ bool Identiconpp::get_bit(const uint16_t bit, const string &digest)
ss >> buf;
std::bitset<4> nibble(buf);
if (nibble[bit % 4])
if (nibble[3 - bit % 4])
{
ttdebug << "Bit " << std::to_string(bit) << " is set in "
ttdebug << "Bit " << std::to_string(bit + 1) << " is set in "
<< digest << ".\n";
ttdebug << nibble << " (" << bit % 4 << ")\n";
return true;
}