it.auties.whatsapp.crypto.MD5 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of whatsappweb4j Show documentation
Show all versions of whatsappweb4j Show documentation
Standalone fully-featured Whatsapp Web API for Java and Kotlin
package it.auties.whatsapp.crypto;
import lombok.NonNull;
import lombok.SneakyThrows;
import lombok.experimental.UtilityClass;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
@UtilityClass
public class MD5 {
private final String MD5 = "MD5";
public byte[] calculate(@NonNull String data) {
return calculate(data.getBytes(StandardCharsets.UTF_8));
}
@SneakyThrows
public byte[] calculate(byte @NonNull [] data) {
var digest = MessageDigest.getInstance(MD5);
digest.update(data);
return digest.digest();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy