aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/elytrium/limboauth/migration
diff options
context:
space:
mode:
authorSouvlakis <soouvlaki@yandex.ru>2022-04-01 00:13:38 +0300
committerSouvlakis <soouvlaki@yandex.ru>2022-04-01 00:13:38 +0300
commita380e0720bfc1c3d94a7bde3d860336e2f0b8ec3 (patch)
tree96e08270c7b95e7d53966d34606dd22cb9cd6c21 /src/main/java/net/elytrium/limboauth/migration
parentb4aa7ebe5c527dff51cb81db0c119b8c286b1e65 (diff)
downloadLimboAuth-a380e0720bfc1c3d94a7bde3d860336e2f0b8ec3.tar.gz
LimboAuth-a380e0720bfc1c3d94a7bde3d860336e2f0b8ec3.tar.bz2
LimboAuth-a380e0720bfc1c3d94a7bde3d860336e2f0b8ec3.zip
Add MoonAuth hash support
Diffstat (limited to 'src/main/java/net/elytrium/limboauth/migration')
-rw-r--r--src/main/java/net/elytrium/limboauth/migration/MigrationHash.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java b/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java
index a93f231..3894507 100644
--- a/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java
+++ b/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java
@@ -54,6 +54,10 @@ public enum MigrationHash {
}),
MD5((hash, password) -> {
return hash.equals(MigrationHash.getDigest(password, "MD5"));
+ }),
+ MOON_SHA256((hash, password) -> {
+ String[] arr = hash.split("\\$"); // $SHA$hash
+ return arr.length == 3 && arr[2].equals(MigrationHash.getDigest(MigrationHash.getDigest(password, "SHA-256"), "SHA-256"));
});
final MigrationHashVerifier verifier;