Example usage for android.util Base64 NO_PADDING

List of usage examples for android.util Base64 NO_PADDING

Introduction

In this page you can find the example usage for android.util Base64 NO_PADDING.

Prototype

int NO_PADDING

To view the source code for android.util Base64 NO_PADDING.

Click Source Link

Document

Encoder flag bit to omit the padding '=' characters at the end of the output (if any).

Usage

From source file:org.bcsphere.bluetooth.tools.Tools.java

public static String encodeBase64(byte[] value) {
    return Base64.encodeToString(value, Base64.NO_WRAP | Base64.NO_PADDING);
}

From source file:net.openid.appauth.AuthorizationRequest.java

private static String generateRandomState() {
    SecureRandom sr = new SecureRandom();
    byte[] random = new byte[STATE_LENGTH];
    sr.nextBytes(random);// w  ww . j av  a 2  s  .  co m
    return Base64.encodeToString(random, Base64.NO_WRAP | Base64.NO_PADDING | Base64.URL_SAFE);
}