Skip to content
Snippets Groups Projects
Commit 7b5927e8 authored by apriestman's avatar apriestman
Browse files

Don't use DatatypeConverter

parent b94b9f0c
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,6 @@
import java.util.Map;
import java.util.HashMap;
import java.util.Arrays;
import javax.xml.bind.DatatypeConverter;
/**
* Utility to calculate a hash for FsContent and store in TSK database
......@@ -85,7 +84,12 @@ static public List<HashResult> calculateHashes(Content content, Collection<HashT
List<HashResult> results = new ArrayList<>();
for (HashType type : hashTypes) {
results.add(new HashResult(type, DatatypeConverter.printHexBinary(digests.get(type).digest()).toLowerCase()));
byte hashData[] = digests.get(type).digest();
StringBuilder sb = new StringBuilder();
for (byte b : hashData) {
sb.append(String.format("%02x", b));
}
results.add(new HashResult(type, sb.toString()));
}
return results;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment