Stabilize HashAlgorithm.fromName()
This commit is contained in:
parent
218d7becae
commit
b64d6e8e55
|
@ -80,7 +80,12 @@ public enum HashAlgorithm {
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
public static HashAlgorithm fromName(String name) {
|
public static HashAlgorithm fromName(String name) {
|
||||||
return NAME_MAP.get(name);
|
String algorithmName = name.toUpperCase();
|
||||||
|
HashAlgorithm algorithm = NAME_MAP.get(algorithmName);
|
||||||
|
if (algorithm == null) {
|
||||||
|
algorithm = NAME_MAP.get(algorithmName.replace("-", ""));
|
||||||
|
}
|
||||||
|
return algorithm;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final int algorithmId;
|
private final int algorithmId;
|
||||||
|
|
Loading…
Reference in New Issue