Files
XACrypto/src/main/java/de/caydenno1/xacrypto/hash/sha224/Digest.java
T
Xiao X 91586225c5 Implement SHA224 (#11)
* start of sha224 implements, tho quite simple

* Update pom.xml

just to make it compile main for testing, simplifies the process
2026-06-04 18:12:34 -04:00

18 lines
483 B
Java

package de.caydenno1.xacrypto.hash.sha224;
import java.nio.charset.StandardCharsets;
import static de.caydenno1.xacrypto.hash.sha224.SHA224.digest;
public class Digest {
public static String digestHex(String text) {
byte[] hash = digest(text.getBytes(StandardCharsets.UTF_8));
StringBuilder builder = new StringBuilder(hash.length * 2);
for (byte b : hash) builder.append(String.format("%02x", b & 0xFF));
return builder.toString();
}
}