2 # -*- encoding: binary -*-
3 # Reads from stdin and outputs the SHA1 hex digest of the input
6 $stdout.sync = $stderr.sync = true
10 digest = Digest::SHA1.new
11 if buf = $stdin.read(bs)
14 end while $stdin.read(bs, buf)
17 $stdout.syswrite("#{digest.hexdigest}\n")