File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
aws-android-sdk-cognitoauth/src/main/java/com/amazonaws/mobileconnectors/cognitoauth/util Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public final static String generateRandom() {
4848 public final static String generateHash (String data ) throws Exception {
4949 String hashedData = data ;
5050 try {
51- byte [] bytes = data .getBytes ("US-ASCII" );
51+ byte [] bytes = data .getBytes (StandardCharsets . US_ASCII );
5252 MessageDigest digest = MessageDigest .getInstance ("SHA-256" );
5353 digest .update (bytes , 0 , bytes .length );
5454 byte [] digestBytes = digest .digest ();
@@ -69,6 +69,6 @@ public final static String encodeBase64(String str) {
6969 return null ;
7070 }
7171 byte [] data = str .getBytes (Charset .forName ("ISO-8859-1" ));
72- return Base64 .encodeToString (data , Base64 .NO_PADDING );
72+ return Base64 .encodeToString (data , Base64 .URL_SAFE | Base64 . NO_WRAP | Base64 . NO_PADDING );
7373 }
7474}
You can’t perform that action at this time.
0 commit comments