Example usage for org.apache.wicket.util.crypt Base64 encodeBase64URLSafeString

List of usage examples for org.apache.wicket.util.crypt Base64 encodeBase64URLSafeString

Introduction

In this page you can find the example usage for org.apache.wicket.util.crypt Base64 encodeBase64URLSafeString.

Prototype

public static String encodeBase64URLSafeString(final byte[] binaryData) 

Source Link

Document

Encodes binary data using a URL-safe variation of the base64 algorithm but does not chunk the output.

Usage

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;
}