mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-26 22:32:07 +01:00
Stabilize HashAlgorithm.fromName()
This commit is contained in:
parent
218d7becae
commit
b64d6e8e55
1 changed files with 6 additions and 1 deletions
|
@ -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 a new issue