List of usage examples for org.apache.wicket.util.crypt Base64 encodeBase64URLSafeString
public static String encodeBase64URLSafeString(final byte[] binaryData)
From source file:dk.frankbille.scoreboard.utils.EncryptionUtils.java
License:Open Source License
public static String md5Encode(String string) { String md5String = null; try {/*from www .j a v a 2 s.c om*/ byte[] bytesOfMessage = string.getBytes("UTF-8"); MessageDigest md = MessageDigest.getInstance("MD5"); byte[] thedigest = md.digest(bytesOfMessage); md5String = Base64.encodeBase64URLSafeString(thedigest); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } return md5String; }