| 1 | # digest |
| 2 | |
| 3 | [](https://travis-ci.org/tebeka/clj-digest) |
| 4 | |
| 5 | `digest` - Message digest library for Clojure. Providing md5, sha-256, ... |
| 6 | |
| 7 | There are several digest functions (such as `md5`, `sha-256` ...) in this |
| 8 | namespace. Each can handle the following input types: |
| 9 | |
| 10 | * java.lang.String |
| 11 | * byte array |
| 12 | * java.io.File |
| 13 | * java.io.InputStream |
| 14 | * Sequence of byte array |
| 15 | |
| 16 | # Usage |
| 17 | |
| 18 | user=> (require 'digest) |
| 19 | nil |
| 20 | ; On a string |
| 21 | user=> (digest/md5 "foo") |
| 22 | "acbd18db4cc2f85cedef654fccc4a4d8" |
| 23 | ; On a file |
| 24 | user=> (use 'clojure.java.io) |
| 25 | nil |
| 26 | user=> (digest/sha-256 (as-file "/tmp/hello.txt")) |
| 27 | "163883d3e0e3b0c028d35b626b98564be8d9d649ed8adb8b929cb8c94c735c59" |
| 28 | |
| 29 | # Installation |
| 30 | Add `[digest "1.4.9"]` to your `project.clj`. |
| 31 | |
| 32 | # License |
| 33 | Copyright© 2017 Miki Tebeka <[email protected]> |
| 34 | |
| 35 | Distributed under the Eclipse Public License (same as Clojure). |