All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.auties.whatsapp.crypto.MD5 Maven / Gradle / Ivy

There is a newer version: 3.5.1
Show newest version
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