Skip to content
This repository has been archived by the owner on Apr 10, 2020. It is now read-only.

All the higher bits are turned off back due to byte values are automatically promoted when reading bytes in order to build ints. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/info/weboftrust/txrefconversion/Bech32.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private static int polymod(byte[] values) {

for (byte b : values) {
byte top = (byte)(chk >> 0x19);
chk = b ^ ((chk & 0x1ffffff) << 5);
chk = ((0xff) & b) ^ ((chk & 0x1ffffff) << 5);
for (int i = 0; i < 5; i++) {
chk ^= ((top >> i) & 1) == 1 ? GENERATORS[i] : 0;
}
Expand Down