md5 hash compuation bug fixed

This commit is contained in:
Christian Mueller
2014-02-17 23:18:47 +01:00
parent 2eb884dbb4
commit c1519668ed
2 changed files with 6 additions and 1 deletions
+4 -1
View File
@@ -12,7 +12,10 @@
(let [input (sreplace (apply str args) #"[\r\n]" "")]
(do (.reset md5Instance)
(.update md5Instance (.getBytes input))
(.toString (new java.math.BigInteger 1 (.digest md5Instance)) 16)))))
(apply str
(map #(let [c (Integer/toHexString (bit-and 0xff %))]
(if (= 1 (count c)) (str "0" c) c))
(.digest md5Instance)))))))
(defmacro redis [cmd & body]
`(car/wcar conn
+2
View File
@@ -15,6 +15,8 @@
:header-font "Anton"})
(def test-short-url "")
(deftest signature
(is (= "07e1c0d9533b5168e18a99f4540448af" (sign "wwq123456"))))
(deftest storage
(testing "Storage"