From 9bafdfe0b1235fdc1f532307158cdf0d96d952f4 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sat, 8 Jun 2019 07:57:36 +0100 Subject: [PATCH] reduce piece size --- .../main/groovy/com/muwire/core/files/FileHasher.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/groovy/com/muwire/core/files/FileHasher.groovy b/core/src/main/groovy/com/muwire/core/files/FileHasher.groovy index 451c4378..963aabe7 100644 --- a/core/src/main/groovy/com/muwire/core/files/FileHasher.groovy +++ b/core/src/main/groovy/com/muwire/core/files/FileHasher.groovy @@ -17,12 +17,12 @@ class FileHasher { * @return the size of each piece in power of 2 */ static int getPieceSize(long size) { - if (size <= 0x1 << 25) - return 18 + if (size <= 0x1 << 27) + return 17 - for (int i = 26; i <= 37; i++) { + for (int i = 28; i <= 37; i++) { if (size <= 0x1L << i) { - return i-7 + return i-10 } }