Merge pull request #72 from huysentruitw/patch-2
Fix bug in DataMatrix padding algorithm
This commit is contained in:
commit
65580ac6e3
|
@ -69,7 +69,12 @@ func addPadding(data []byte, toCount int) []byte {
|
|||
}
|
||||
for len(data) < toCount {
|
||||
R := ((149 * (len(data) + 1)) % 253) + 1
|
||||
data = append(data, byte((129+R)%254))
|
||||
tmp := 129 + R;
|
||||
if (tmp > 254) {
|
||||
tmp = tmp - 254
|
||||
}
|
||||
|
||||
data = append(data, byte(tmp))
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue