Added color-size check to sigil algorithm.
This commit is contained in:
parent
4e5397a2a2
commit
ddd55f6221
|
@ -54,6 +54,11 @@ void Identiconpp::check_entropy(const string &digest, algorithm type)
|
|||
}
|
||||
case algorithm::sigil:
|
||||
{
|
||||
if (_foreground.size() > 256)
|
||||
{
|
||||
throw std::invalid_argument(
|
||||
"sigil algorithm does not support more than 256 colors.");
|
||||
}
|
||||
entropy_provided = digest.length() * 4;
|
||||
entropy_required = (_columns / 2 + _columns % 2) * _rows + 8;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue
Block a user