Skip to content

Commit

Permalink
changed digest algorithm for a method
Browse files Browse the repository at this point in the history
  • Loading branch information
waterflow80 committed Aug 18, 2023
1 parent 96493aa commit 6338c44
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import uk.ac.ebi.eva.evaseqcol.digests.DigestCalculator;
import uk.ac.ebi.eva.evaseqcol.model.NameLengthPairEntity;
import uk.ac.ebi.eva.evaseqcol.refget.SHA512ChecksumCalculator;
import uk.ac.ebi.eva.evaseqcol.utils.JSONExtData;

import javax.persistence.Basic;
Expand Down Expand Up @@ -189,11 +188,11 @@ private static List<NameLengthPairEntity> constructNameLengthPairList(

/**
* Return the sorted-name-length-pair list for the given list of nameLengthPairEntity*/
public static List<String> constructSortedNameLengthPairs(List<NameLengthPairEntity> nameLengthPairList) {
SHA512ChecksumCalculator sha512ChecksumCalculator = new SHA512ChecksumCalculator();
public static List<String> constructSortedNameLengthPairs(List<NameLengthPairEntity> nameLengthPairList) throws IOException {
DigestCalculator digestCalculator = new DigestCalculator();
List<String> sortedNameLengthPairs = new ArrayList<>();
for (NameLengthPairEntity entity: nameLengthPairList) {
String nameLengthHash = sha512ChecksumCalculator.calculateChecksum(entity.toString());
String nameLengthHash = digestCalculator.getSha512Digest(entity.toString());
sortedNameLengthPairs.add(nameLengthHash);
}
// Sorting the name-length-pair list according to the elements' natural order (alphanumerically)
Expand Down

0 comments on commit 6338c44

Please sign in to comment.