Secure one-way hashing
Clojure
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/neatonk
test/neatonk/shah
.gitignore
README.md
project.clj

README.md

shah

Secure one-way hashing

Leiningen

Add this line to the :dependencies in your project.clj

[com.neatonk/shah 0.1.0]

Usage

(use '[clojure.java.io :only [file]])
(use '[neatonk.shah :only [digest md5sum sha256sum]])

(digest "The quick brown fox jumps over the lazy dog" "MD5")
;; => #<byte[] [B@50d7c5>

(spit "path/to/somefile.txt" "The quick brown fox jumps over the lazy dog")
(digest (file "path/to/somefile.txt") "MD5")
;; => #<byte[] [B@22db19d3>

(md5sum "The quick brown fox jumps over the lazy dog")
(md5sum (file "path/to/somefile.txt"))
;; => "9e107d9d372bb6826bd81d3542a419d6"

(sha256sum "The quick brown fox jumps over the lazy dog")
(sha256sum (file "path/to/somefile.txt"))
;; => "d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592"

License

Copyright © 2012 Kevin Neaton

Distributed under the Eclipse Public License, the same as Clojure.