public static byte[] hacher(String message) { byte[] m = message.getBytes(); byte[] hash = null; try { hash = MessageDigest.getInstance("MD5").digest(m); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return hash; } public static void main(String[] args) { System.out.println(hacher("Test")); }