* start of sha224 implements, tho quite simple * Update pom.xml just to make it compile main for testing, simplifies the process
18 lines
483 B
Java
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();
|
|
}
|
|
}
|