Skip to content

Commit

Permalink
修复了Crypt.java中的方法名,优化了代码可读性。
Browse files Browse the repository at this point in the history
  • Loading branch information
shulng committed Jun 4, 2024
1 parent bb68ad6 commit 9be2da1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/cc/baka9/catseedlogin/util/Crypt.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ public static String encrypt(final String name, final String password){
try {
final MessageDigest md = MessageDigest.getInstance("SHA-512");
md.update(text.getBytes(StandardCharsets.UTF_8), 0, text.length());
return byteArrayToHexString(md.digest());
return toHexString(md.digest());
} catch (final NoSuchAlgorithmException e) {
return null;
}
}

public static String byteArrayToHexString(byte... args){
public static String toHexString(byte... args){
char[] chars = new char[args.length * 2];
for (int i = 0; i < args.length; i++) {
chars[(i * 2)] = CRYPTCHARS[(args[i] >> 4 & 0xF)];
Expand Down

0 comments on commit 9be2da1

Please sign in to comment.