File tree 2 files changed +13
-7
lines changed
2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 35
35
:auth {:access-key-id \" accesskey\" , :secret-access-key \" secretkey\" }}
36
36
{:id :resource5
37
37
:url \" http://example.com/resource5.gz\"
38
- :sha1 \" 456789abcdef01234567890abcdef0123456789a \"
38
+ :sha512 \" 456789abcdef01234567890abcdef0123456789abcdef01234567890abcdef01234567890abcdebcdef01234567890abcdef01234567890abcdebcdef0123456 \"
39
39
:packed :gzip}]
40
40
:download-to \" .cavia\" })"
41
41
[name profile]
166
166
priority will be used."
167
167
{:md5 0
168
168
:sha1 1
169
- :sha256 2 })
169
+ :sha256 2
170
+ :sha512 3 })
170
171
171
172
(defn- enabled-hash
172
173
[r]
173
- (->> (select-keys r [:md5 :sha1 :sha256 ])
174
+ (->> (select-keys r [:md5 :sha1 :sha256 :sha512 ])
174
175
(sort-by #((first %) hash-algo-order) >)
175
176
first))
176
177
181
182
:md5 digest/md5
182
183
:sha1 digest/sha1
183
184
:sha256 digest/sha-256
185
+ :sha512 digest/sha-512
184
186
(throw (IllegalArgumentException. (str " Invalid hash algorithm: " algo))))
185
187
(io/file f))))
186
188
Original file line number Diff line number Diff line change 11
11
{:id :test-resource2
12
12
:url " http://localhost:8080/test.png"
13
13
:sha1 " unverifiedsha1" }
14
- {:id :test-resource3
14
+ {:id :test-resource-md5
15
15
:url " http://localhost:8080/test.png"
16
16
:md5 " 0656b409231ee9bd8c5c9272647c69a1" }
17
- {:id :test-resource4
17
+ {:id :test-resource-sha256
18
18
:url " http://localhost:8080/test.png"
19
19
:sha256 " 55902cd4056e2bd57ced9296c826e4df42f07457c96ce72afe8652d0d6dd89b3" }
20
+ {:id :test-resource-sha512
21
+ :url " http://localhost:8080/test.png"
22
+ :sha512 " 71122b126cf93561275d711d543bd09db82f68637a603fec49e5e0a1312a1e3749580650d8adbd8989affe036a052019d7602c53f2456f117c1960c35b091ccb" }
20
23
{:id :test-resource-gzip
21
24
:url " http://localhost:8080/test.png.gz"
22
25
:sha1 " 07dba3bd9f227f58134d339b1609e0a913abe0de"
75
78
(testing " returns true if the file's hash is valid"
76
79
(are [k] (true ? (cavia/valid? k))
77
80
:test-resource
78
- :test-resource3
79
- :test-resource4
81
+ :test-resource-md5
82
+ :test-resource-sha256
83
+ :test-resource-sha512
80
84
:test-resource-ftp
81
85
:test-resource-s3 ))
82
86
(testing " returns false if the file's hash is invalid"
You can’t perform that action at this time.
0 commit comments