Hi,
On net, for "algorithm 253-state", I find this rule :
R = ((149 * P) MOD 253) + 1
MC = (129 + R) MOD 254
with tis algorithm , if P=28, R=125 and finally MC = 0 ( 254 MOD 254).
In the Randomize253State (with cwValue=129,cwPosition=28 ), the return value is 254 instead 0.
possible solutions if it's a bug :
replace "tmp = cwValue + pseudoRandom;" by "tmp = (cwValue + pseudoRandom) % 254 ;"
or
replace "if(tmp > 254") by "if(tmp >= 254)"
the function :
static DmtxByte
Randomize253State(DmtxByte cwValue, int cwPosition)
{
int pseudoRandom, tmp;
pseudoRandom = ((149 * cwPosition) % 253) + 1;
tmp = cwValue + pseudoRandom;
if(tmp > 254)
tmp -= 254;
assert(tmp >= 0 && tmp < 256);
return (DmtxByte)tmp;
}
it's 0.7.4 version