Created
February 7, 2017 10:25
-
-
Save kopchik/173e9c3caa99c0a787a90d0e2da85ca6 to your computer and use it in GitHub Desktop.
Proposed patch to make md5 checksum mismatch problem less easy to occur
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/rest/rest-sqs/src/main/scala/org/elasticmq/rest/sqs/SQSRestServerBuilder.scala | |
+++ b/rest/rest-sqs/src/main/scala/org/elasticmq/rest/sqs/SQSRestServerBuilder.scala | |
@@ -243,7 +243,7 @@ object MD5Util { | |
def md5Digest(s: String) = { | |
val md5 = MessageDigest.getInstance("MD5") | |
md5.reset() | |
- md5.update(s.getBytes) | |
+ md5.update(s.getBytes("UTF-8")) | |
md5.digest().map(0xFF & _).map { "%02x".format(_) }.foldLeft(""){_ + _} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment