Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import android.util.Log;

public class Main {
    public static String GetHash(byte[] data) {
        MessageDigest md;
        String hash = null;
        try {
            md = MessageDigest.getInstance("MD5");
            hash = new BigInteger(1, md.digest(data)).toString(16);
        } catch (NoSuchAlgorithmException e) {
            Log.i("BMSUtil", "Hashing Error!");
            e.printStackTrace();
        }
        return hash;
    }
}