Here you can find the source of md5Bytes(String message)
Parameter | Description |
---|---|
message | the message to encrypt |
public static byte[] md5Bytes(String message)
//package com.java2s; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { /**/*from ww w . j a v a2 s . c om*/ * Encrypt the passed String using MD5. * * @param message the message to encrypt * * @return the MD5 hash as 16 bytes. */ public static byte[] md5Bytes(String message) { try { MessageDigest md = MessageDigest.getInstance("MD5"); return (md.digest(message.getBytes())); } catch (NoSuchAlgorithmException e) { } return (null); } }