Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.security.MessageDigest;

public class Main {
    public static byte[] md5Digest(byte[] password) throws Exception {
        try {
            MessageDigest alg = MessageDigest.getInstance("MD5");
            alg.update(password);
            byte[] digest = alg.digest();
            return digest;
        } catch (Exception e) {
            throw new Exception(e);
        }
    }
}