From 6338c4478eddd67f5b90d1a69a25ade41b544e20 Mon Sep 17 00:00:00 2001 From: waterflow80 Date: Fri, 18 Aug 2023 10:51:27 +0100 Subject: [PATCH] changed digest algorithm for a method --- .../eva/evaseqcol/entities/SeqColExtendedDataEntity.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/uk/ac/ebi/eva/evaseqcol/entities/SeqColExtendedDataEntity.java b/src/main/java/uk/ac/ebi/eva/evaseqcol/entities/SeqColExtendedDataEntity.java index 8011bc3..05ab61c 100644 --- a/src/main/java/uk/ac/ebi/eva/evaseqcol/entities/SeqColExtendedDataEntity.java +++ b/src/main/java/uk/ac/ebi/eva/evaseqcol/entities/SeqColExtendedDataEntity.java @@ -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; @@ -189,11 +188,11 @@ private static List constructNameLengthPairList( /** * Return the sorted-name-length-pair list for the given list of nameLengthPairEntity*/ - public static List constructSortedNameLengthPairs(List nameLengthPairList) { - SHA512ChecksumCalculator sha512ChecksumCalculator = new SHA512ChecksumCalculator(); + public static List constructSortedNameLengthPairs(List nameLengthPairList) throws IOException { + DigestCalculator digestCalculator = new DigestCalculator(); List 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)