mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Bug fix to unrandomization routine from sanfordsquires
git-svn-id: https://zxing.googlecode.com/svn/trunk@707 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
62d9959a3c
commit
ce341d92aa
|
@ -423,7 +423,7 @@ final class DecodedBitStreamParser {
|
|||
count = 250 * (d1 - 249) + bits.readBits(8);
|
||||
}
|
||||
for (int i = 0; i < count; i++) {
|
||||
result.append(unrandomize255State(bits.readBits(8), count));
|
||||
result.append(unrandomize255State(bits.readBits(8), i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -434,11 +434,7 @@ final class DecodedBitStreamParser {
|
|||
int base256CodewordPosition) {
|
||||
int pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1;
|
||||
int tempVariable = randomizedBase256Codeword - pseudoRandomNumber;
|
||||
if (tempVariable >= 0) {
|
||||
return (char) tempVariable;
|
||||
} else {
|
||||
return (char) (tempVariable + 256);
|
||||
}
|
||||
return tempVariable >= 0 ? (char) tempVariable : (char) (tempVariable + 256);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue