org.bdware.doip.event.verified.HashUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of doip-audit-tool Show documentation
Show all versions of doip-audit-tool Show documentation
doip audit tool developed by bdware
The newest version!
package org.bdware.doip.event.verified;
import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
import org.zz.gmhelper.SM3Util;
import java.nio.charset.StandardCharsets;
public class HashUtil {
public static String hash(String content) {
return ByteUtils.toHexString(SM3Util.hash(content.getBytes(StandardCharsets.UTF_8)));
}
public static boolean verify(String content, String hash) {
return hash(content).equals(hash);
}
}