After checking this question (How can I generate an MD5 hash?) and reading the MessageDigest documentation, I attempted to hash a simple string. But for some reason every string I pass into the method returns the same value. Below shows the code I wrote.
byte[] bytesOfMessage = "helloworld".getBytes("UTF-8");
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] thedigest = md.digest(bytesOfMessage);
System.out.println(thedigest);
and is there anyway to limit the number of characters I get from the hash?