Skip to content

Commit 19fd2b3

Browse files
committed
char-based summing replaced with byte-based one
1 parent a9426c6 commit 19fd2b3

File tree

1 file changed

+3
-3
lines changed
  • portable/comp-transfer/src/main/java/org/bosik/merklesync

1 file changed

+3
-3
lines changed

portable/comp-transfer/src/main/java/org/bosik/merklesync/HashUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,14 @@ public static String sum(String a, String b)
187187

188188
public static String sum(Iterable<String> hashes)
189189
{
190-
String result = null;
190+
byte[] sum = null;
191191

192192
for (String hash : hashes)
193193
{
194-
result = sum(result, hash);
194+
sum = add(sum, strToByte(hash));
195195
}
196196

197-
return result;
197+
return byteToStr(sum);
198198
}
199199

200200
public static byte[] add(byte[] a, byte[] b)

0 commit comments

Comments
 (0)