Java MD5 String md5raw(String data)

Here you can find the source of md5raw(String data)

Description

mdraw

License

Apache License

Declaration

public static byte[] md5raw(String data) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
 * Copyright (c) 2011- kotemaru@kotemaru.org
 ******************************************************************************/

import java.security.MessageDigest;

public class Main {
    private final static String MD = "MD5";
    private final static String UTF8 = "UTF-8";

    public static byte[] md5raw(String data) {
        try {//from w w w.  ja  v  a  2 s  .  c  o  m
            MessageDigest md = MessageDigest.getInstance(MD);
            md.update(data.getBytes(UTF8));
            return md.digest();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. md5Hex(String message)
  2. md5Hex(String message)
  3. md5Hex(String s)
  4. md5hex(String source)
  5. md5Hex(String str)
  6. md5Representation(String data)
  7. md5Signature(TreeMap params, String secret)
  8. md5Signature(TreeMap params, String secret)
  9. md5String(String input)