Skip to content

Commit be2cf88

Browse files
committed
Internal refactoring
1 parent 950c65f commit be2cf88

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/main/java/org/apache/commons/codec/digest/HmacUtils.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -657,17 +657,12 @@ public static String hmacSha512Hex(final String key, final String valueToDigest)
657657
/**
658658
* Tests whether this algorithm is available
659659
*
660-
* @param name the name to check.
660+
* @param hmacAlgorithms the HmacAlgorithms to check.
661661
* @return whether this algorithm is available.
662662
* @since 1.11
663663
*/
664-
public static boolean isAvailable(final HmacAlgorithms name) {
665-
try {
666-
Mac.getInstance(name.getName());
667-
return true;
668-
} catch (final NoSuchAlgorithmException e) {
669-
return false;
670-
}
664+
public static boolean isAvailable(final HmacAlgorithms hmacAlgorithms) {
665+
return isAvailable(hmacAlgorithms.getName());
671666
}
672667

673668
/**

0 commit comments

Comments
 (0)