aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Ilin <hevav@hevav.dev>2022-04-01 00:23:43 +0300
committerGitHub <noreply@github.com>2022-04-01 00:23:43 +0300
commitd8ed7d80a2f2cea05161ff5c027e434d78380807 (patch)
tree96e08270c7b95e7d53966d34606dd22cb9cd6c21
parentb4aa7ebe5c527dff51cb81db0c119b8c286b1e65 (diff)
parenta380e0720bfc1c3d94a7bde3d860336e2f0b8ec3 (diff)
downloadLimboAuth-d8ed7d80a2f2cea05161ff5c027e434d78380807.tar.gz
LimboAuth-d8ed7d80a2f2cea05161ff5c027e434d78380807.tar.bz2
LimboAuth-d8ed7d80a2f2cea05161ff5c027e434d78380807.zip
Add MoonAuth hash support
Add MoonAuth hash support
-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;