mirror of
https://github.com/MaintainTeam/Hypatia.git
synced 2025-03-01 05:48:23 +03:00
Trim signature varaint number off for memory savings
This commit is contained in:
parent
272a51304c
commit
521ae4891d
2 changed files with 9 additions and 1 deletions
|
@ -133,11 +133,17 @@ class Database {
|
|||
if (database.getName().contains(".hdb")) {//.hdb format: md5, size, name
|
||||
while ((line = reader.readLine()) != null) {
|
||||
String[] lineS = line.split(":");
|
||||
if(Utils.TRIM_VARIANT_NUMBER) {
|
||||
lineS[2] = lineS[2].split("-")[0];
|
||||
}
|
||||
signaturesMD5.put(lineS[0].substring(0, Utils.MAX_HASH_LENGTH), lineS[2]);
|
||||
}
|
||||
} else if (database.getName().contains(".hsb")) {//.hsb format: sha256, size, name
|
||||
while ((line = reader.readLine()) != null) {
|
||||
String[] lineS = line.split(":");
|
||||
if(Utils.TRIM_VARIANT_NUMBER) {
|
||||
lineS[2] = lineS[2].split("-")[0];
|
||||
}
|
||||
if (lineS[0].length() == 32) {
|
||||
signaturesSHA1.put(lineS[0].substring(0, Utils.MAX_HASH_LENGTH), lineS[2]);
|
||||
} else {
|
||||
|
|
|
@ -36,7 +36,9 @@ class Utils {
|
|||
public final static int MAX_SCAN_SIZE = (1000 * 1000) * 80; //80MB
|
||||
public final static int MAX_SCAN_SIZE_REALTIME = MAX_SCAN_SIZE / 2; //40MB
|
||||
|
||||
public final static int MAX_HASH_LENGTH = 16;
|
||||
public final static int MAX_HASH_LENGTH = 12;
|
||||
public final static boolean TRIM_VARIANT_NUMBER = true;
|
||||
|
||||
public static int FILES_SCANNED = 0;
|
||||
private static ThreadPoolExecutor threadPoolExecutor = null;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue