File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
src/main/java/com/maxmind/minfraud/request Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 5
5
6
6
import java .math .BigInteger ;
7
7
import java .nio .charset .Charset ;
8
+ import java .nio .charset .StandardCharsets ;
8
9
import java .security .MessageDigest ;
9
10
import java .security .NoSuchAlgorithmException ;
10
11
@@ -52,7 +53,7 @@ public Account.Builder userId(String id) {
52
53
public Account .Builder username (String username ) {
53
54
try {
54
55
MessageDigest d = MessageDigest .getInstance ("MD5" );
55
- d .update (username .getBytes (Charset . forName ( "UTF8" ) ));
56
+ d .update (username .getBytes (StandardCharsets . UTF_8 ));
56
57
BigInteger i = new BigInteger (1 , d .digest ());
57
58
this .usernameMd5 = String .format ("%032x" , i );
58
59
return this ;
Original file line number Diff line number Diff line change 8
8
import java .math .BigInteger ;
9
9
import java .net .IDN ;
10
10
import java .nio .charset .Charset ;
11
+ import java .nio .charset .StandardCharsets ;
11
12
import java .security .MessageDigest ;
12
13
import java .security .NoSuchAlgorithmException ;
13
14
import java .util .Collections ;
@@ -156,7 +157,7 @@ public String getAddress() {
156
157
String cleanAddress = cleanAddress (address );
157
158
try {
158
159
MessageDigest d = MessageDigest .getInstance ("MD5" );
159
- d .update (cleanAddress .getBytes (Charset . forName ( "UTF8" ) ));
160
+ d .update (cleanAddress .getBytes (StandardCharsets . UTF_8 ));
160
161
BigInteger i = new BigInteger (1 , d .digest ());
161
162
return String .format ("%032x" , i );
162
163
} catch (NoSuchAlgorithmException e ) {
You can’t perform that action at this time.
0 commit comments