作者:AD社团 | 来源:互联网 | 2024-10-27 12:59
Currently:123456789func (rs *RollSum) Bits() int { bits := blobBits rsum := rs.Diges
Currently:
1 2 3 4 5 6 7 8 9
| func (rs *RollSum) Bits() int {
bits := blobBits
rsum := rs.Digest()
rsum >>= blobBits
for ; (rsum>>1)&1 != 0; bits++ {
rsum >>= 1
}
return bits
} |
All values > 13 are 1 less than they should be.
Noticed when working on https://github.com/aidanhs/rollsum-tests.git
该提问来源于开源项目:perkeep/perkeep
I've run the proposed patch against the tests that prompted me to raise this issue and it looks good to me. I don't know what I was thinking with the
part.