Java MD5 md5HashStringToByte(String hash)

Here you can find the source of md5HashStringToByte(String hash)

Description

Creates an MD5 byte array from the given MD5 hash.

License

Open Source License

Parameter

Parameter Description
hash the hash to convert back to bytes

Return

String value of the given bytes

Declaration

public static byte[] md5HashStringToByte(String hash) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*w  w  w  .j  a  v  a2s . c  om*/
     * Creates an MD5 byte array from the given MD5 hash.
     *
     * @param hash the hash to convert back to bytes
     * @return String value of the given bytes
     */
    public static byte[] md5HashStringToByte(String hash) {
        byte[] buf = new byte[16];
        int i = 0;
        while (hash.length() > 0) {
            buf[i++] = (byte) Integer.parseInt(hash.substring(0, 2), 16);
            hash = hash.substring(2);
        }
        return buf;
    }
}

Related

  1. md5_id(byte[] md5digest)
  2. md5bytesToHex(byte[] md5)
  3. md5Encode(byte[] content)
  4. md5Encode(String strIn)
  5. md5HashByteToString(byte[] bytes)
  6. md5Hex(final String text)
  7. md5Init()
  8. md5Memcpy(byte[] output, byte[] input, int outpos, int inpos, int len)
  9. md5ToHex(byte[] hash)