Skip to content

Commit

Permalink
sha2 1.0.1 (new formula)
Browse files Browse the repository at this point in the history
The world鈥檚 tiniest checksumming utility.(Probably. It鈥檚 27KB when
compiled).

Handles SHA-256, SHA-384 and SHA-512. Ultra-portable. BSD licensed.
Generally a neat tiny tool that I鈥檓 fond of.

Closes Homebrew/legacy-homebrew#37243.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
  • Loading branch information
DomT4 authored and MikeMcQuaid committed Feb 28, 2015
1 parent bb6fb88 commit da5dd55
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Formula/sha2.rb
@@ -0,0 +1,20 @@
class Sha2 < Formula
homepage "http://www.aarongifford.com/computers/sha.html"
url "http://www.aarongifford.com/computers/sha2-1.0.1.tgz"
sha1 "ffbc69e0b0ab47f70e61aeb14fa16ba2b74dc728"

option "without-check", "Skip compile-time tests"

def install
system ENV.cc, "-o", "sha2", "sha2prog.c", "sha2.c"
system "perl", "sha2test.pl" if build.with? "check"
bin.install "sha2"
end

test do
(testpath/"checkme.txt").write("homebrew")
output = pipe_output("#{bin}/sha2 -q -256 #{testpath}/checkme.txt")
expected = "12c87370d1b5472793e67682596b60efe2c6038d63d04134a1a88544509737b4"
assert output.include? expected
end
end

0 comments on commit da5dd55

Please sign in to comment.