From d52375efeefe85d4d241f3fec5a3f7c37c36e331 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 9 Jul 2017 13:05:42 +0200 Subject: Print blocks --- zsig/sum.go | 5 +++++ zsig/zsig.go | 2 -- zsig/zsig_test.go | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'zsig') diff --git a/zsig/sum.go b/zsig/sum.go index 846a140..7ce9a9d 100644 --- a/zsig/sum.go +++ b/zsig/sum.go @@ -5,6 +5,11 @@ import ( "io" ) +const ( + Algoritghm = "SHA512/256" + BlockSize = 65536 +) + // Sum calculates SHA512/256 func Sum(r io.Reader, blockSize int) chan []byte { c := make(chan []byte, 1) diff --git a/zsig/zsig.go b/zsig/zsig.go index 6c7c16a..d9e6530 100644 --- a/zsig/zsig.go +++ b/zsig/zsig.go @@ -22,8 +22,6 @@ const ( flagComment = 1 << 4 ) -const BlockSize = 65536 - var fake = []byte{gzipID1, gzipID2, gzipDeflate, flagComment, 0, 0, 0, 0, 0, 3} type Header struct { diff --git a/zsig/zsig_test.go b/zsig/zsig_test.go index a438b61..001d11d 100644 --- a/zsig/zsig_test.go +++ b/zsig/zsig_test.go @@ -23,8 +23,11 @@ func TestZsig(t *testing.T) { if err != nil { t.Error(err) } - t.Log(z.Header) + + for block := range Sum(z, BlockSize) { + t.Logf("%x", block) + } }) } } -- cgit v1.2.3