Skip to content

Commit 6fef738

Browse files
committed
fix MD5 checksum computation
1 parent 265fe64 commit 6fef738

File tree

1 file changed

+1
-4
lines changed
  • semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac

1 file changed

+1
-4
lines changed

semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac/MD5.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ private static String bytesToHex(byte[] bytes) {
2626
}
2727

2828
public static String digest(CharSequence chars) throws NoSuchAlgorithmException {
29-
CharBuffer buf = CharBuffer.wrap(chars);
30-
byte[] bytes = StandardCharsets.UTF_8.encode(buf).array();
3129
MessageDigest md5 = MessageDigest.getInstance("MD5");
32-
md5.digest(bytes);
33-
return bytesToHex(md5.digest());
30+
return bytesToHex(md5.digest(chars.toString().getBytes()));
3431
}
3532
}

0 commit comments

Comments
 (0)