md5 hash compuation bug fixed
This commit is contained in:
@@ -12,7 +12,10 @@
|
|||||||
(let [input (sreplace (apply str args) #"[\r\n]" "")]
|
(let [input (sreplace (apply str args) #"[\r\n]" "")]
|
||||||
(do (.reset md5Instance)
|
(do (.reset md5Instance)
|
||||||
(.update md5Instance (.getBytes input))
|
(.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]
|
(defmacro redis [cmd & body]
|
||||||
`(car/wcar conn
|
`(car/wcar conn
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
:header-font "Anton"})
|
:header-font "Anton"})
|
||||||
(def test-short-url "")
|
(def test-short-url "")
|
||||||
|
|
||||||
|
(deftest signature
|
||||||
|
(is (= "07e1c0d9533b5168e18a99f4540448af" (sign "wwq123456"))))
|
||||||
|
|
||||||
(deftest storage
|
(deftest storage
|
||||||
(testing "Storage"
|
(testing "Storage"
|
||||||
|
|||||||
Reference in New Issue
Block a user