Skip to content

Commit c36da8d

Browse files
committed
extracted sha-384; updated readme; prepared release
1 parent 1fac618 commit c36da8d

File tree

4 files changed

+47
-6
lines changed

4 files changed

+47
-6
lines changed

Diff for: README.adoc

+36-5
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ Add the following to your http://github.com/technomancy/leiningen[Leiningen's] `
1717

1818
[source,clojure]
1919
----
20-
[net.tbt-post/zlib-tiny "0.4.1"]
20+
[net.tbt-post/zlib-tiny "0.5.0"]
2121
----
2222

23-
CAUTION: From version v0.3.2 and upward the library requires Java class versions 53.0 and newer (J11+), thus if in your needs is to use it with Java 1.8 please switch back to older (0.2.x) version of the library or try to rebuild the library locally.
23+
CAUTION: From version v0.3.2 and upward the library may require Java class versions 53.0 and newer (J11+), thus if in your needs is to use it with some of Java 1.8, and the library build is not compatible with your version of Java, please switch back to older (0.2.x) version of the library (if your project not requires fresh features) or try to rebuild the library locally. We are doing our best to keep the library backward compatible with older Java versions, but unfortunately can not guaranty complete compatibility with wide range of java builds.
2424

2525
=== Compress
2626

@@ -73,6 +73,20 @@ CAUTION: From version v0.3.2 and upward the library requires Java class versions
7373
=> 3421780262
7474
----
7575

76+
[source,clojure]
77+
----
78+
;; CRC32C example
79+
(crc32c (.getBytes "123456789"))
80+
=> 3808858755
81+
----
82+
83+
[source,clojure]
84+
----
85+
;; Adler32 example
86+
(adler32 (.getBytes "123456789"))
87+
=> 152961502
88+
----
89+
7690
[source,clojure]
7791
----
7892
;; CRC64 example
@@ -92,6 +106,12 @@ $ echo -n 'test it!' | shasum -a 1
92106
93107
$ echo -n 'test it!' | shasum -a 256
94108
9c507d01834b2749d088122a7b3d200957f9b25579b5ce6b490e3b2067ee4f66 -
109+
110+
$ echo -n 'test it!' | shasum -a 384
111+
6e5cc5271b2255f2cf4154c3170c5fb09059c79d28d182ac2caa59bd607ea87c09637d8f2f7b400ac80810f13027716a -
112+
113+
$ echo -n 'test it!' | shasum -a 512
114+
15353093ef47d2eadefc55d7bc641b6f1150e0b28a609d2368394748091f20b9125e98fe0603b2fbe57f9d65a9b286a8d0dbf70e8f597525051b6f9220e9b61f -
95115
----
96116

97117
[source,clojure]
@@ -102,6 +122,8 @@ $ echo -n 'test it!' | shasum -a 256
102122
=> "1393ce5dfcf39109a420eb583ecfdeacc28c783a"
103123
(-> "test it!" str->bytes sha-256 hexlify)
104124
=> "9c507d01834b2749d088122a7b3d200957f9b25579b5ce6b490e3b2067ee4f66"
125+
(-> "test it!" str->bytes sha-384 hexlify)
126+
=> "6e5cc5271b2255f2cf4154c3170c5fb09059c79d28d182ac2caa59bd607ea87c09637d8f2f7b400ac80810f13027716a"
105127
(-> "test it!" str->bytes sha-512 hexlify)
106128
=> "15353093ef47d2eadefc55d7bc641b6f1150e0b28a609d2368394748091f20b9125e98fe0603b2fbe57f9d65a9b286a8d0dbf70e8f597525051b6f9220e9b61f"
107129
----
@@ -115,11 +137,20 @@ $ lein test
115137
...
116138
117139
lein test zlib-tiny.checksum
140+
Test input string: 123456789
141+
Test input bytes: 313233343536373839
142+
CRC32 checks:
143+
"Elapsed time: 0.034417 msecs"
144+
CRC32C checks:
145+
"Elapsed time: 0.037292 msecs"
146+
Adler32 checks:
147+
"Elapsed time: 0.316375 msecs"
148+
CRC64 checks:
149+
"Elapsed time: 0.210833 msecs"
118150
119151
lein test zlib-tiny.compress
120152
121-
Ran 3 tests containing 10 assertions.
122-
0 failures, 0 errors.
153+
Ran 3 tests containing 13 assertions.
123154
----
124155

125156
== Manual Build
@@ -131,7 +162,7 @@ $ lein install
131162

132163
== License
133164

134-
Copyright © 2017-2021
165+
Copyright © 2017-2023
135166

136167
Distributed under the http://www.apache.org/licenses/LICENSE-2.0[Apache License v 2.0]
137168

Diff for: project.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject net.tbt-post/zlib-tiny "0.4.1"
1+
(defproject net.tbt-post/zlib-tiny "0.5.0"
22
:description "Tiny Clojure ZLib helper"
33
:url "https://github.com/source-c/zlib-tiny"
44
:license {:name "Apache License v2.0"

Diff for: src-clj/zlib_tiny/core.clj

+4
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@
131131
^bytes [^bytes b]
132132
(wrap-digest "SHA-256" b))
133133

134+
(defn sha-384
135+
^bytes [^bytes b]
136+
(wrap-digest "SHA-384" b))
137+
134138
(defn sha-512
135139
^bytes [^bytes b]
136140
(wrap-digest "SHA-512" b))

Diff for: test/zlib_tiny/checksum.clj

+6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@
4141
str->bytes
4242
sha-256
4343
hexlify))))
44+
(testing "SHA384"
45+
(is (= "6e5cc5271b2255f2cf4154c3170c5fb09059c79d28d182ac2caa59bd607ea87c09637d8f2f7b400ac80810f13027716a"
46+
(-> test-string
47+
str->bytes
48+
sha-384
49+
hexlify))))
4450
(testing "SHA512"
4551
(is (= "15353093ef47d2eadefc55d7bc641b6f1150e0b28a609d2368394748091f20b9125e98fe0603b2fbe57f9d65a9b286a8d0dbf70e8f597525051b6f9220e9b61f"
4652
(-> test-string

0 commit comments

Comments
 (0)