Skip to content

Commit

Permalink
removed import
Browse files Browse the repository at this point in the history
  • Loading branch information
leonard committed Nov 14, 2017
1 parent dd8cac7 commit b19fdcd
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
import android.util.Base64;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.SecureRandom;

/**
* Utility class to generate random string, hash, and encoding.
*
*/

public final class Pkce {

/**
Expand All @@ -49,7 +48,7 @@ public final static String generateRandom() {
public final static String generateHash(String data) throws Exception {
String hashedData = data;
try {
byte[] bytes = data.getBytes(StandardCharsets.US_ASCII);
byte[] bytes = data.getBytes("US-ASCII");
MessageDigest digest = MessageDigest.getInstance("SHA-256");
digest.update(bytes, 0, bytes.length);
byte[] digestBytes = digest.digest();
Expand Down

0 comments on commit b19fdcd

Please sign in to comment.